show or hide Fields in d365 using JavaScript
In d365 we can get the Logical Name of the subgrid and then by using setVisible(true) or setVisible(false) property we can hide the Fields.
setVisible(true) //show the Field
setVisible(fakse) //hide the Field
Ex.
function ShowhideField(paramContext){
var formContext = paramContext.getFormContext();
var fieldnames = formContext.Attribute();
console.log(Controls) // It will show all the field names
var getControl = formContext.getAttribute('field name').setVisible(false); // It will hide the field
var getControl = formContext.getAttribute('field name').setVisible(true); // It will show the field
}
formContext.getAttribute(); // This method will return all the Field names available on form or page
Please Leave a comment if anything is required.
d365
dynamics365
mda365
mda365.blogspot.com
Thanks