D365 CE: Error while activating BPF “An attribute with the specified name already exists. Exception Message: Column names in each table must be unique. Column name ‘stageid’ in table ‘EntityName’ is specified more than once.”

Recently, while activating a Business Process Flow, we got below error: "An attribute with the specified name already exists. Exception Message: Column names in each table must be unique. Column name 'stageid' in table 'EntityName' is specified more than once." While checking the entity metadata for which we had created BPF, we found that Business … Continue reading D365 CE: Error while activating BPF “An attribute with the specified name already exists. Exception Message: Column names in each table must be unique. Column name ‘stageid’ in table ‘EntityName’ is specified more than once.”

D365 CE: Get Logged in User’s Security Roles using JavaScript

Many times we come across requirements such as show/hide ribbon buttons based on logged in user's security role. Earlier, we used to get security roles of logged in user at client side using Xrm.Utility.getGlobalContext().userSettings.securityRoles which used to return array of GUID value of each security role. Now that it's deprecated, we can use Xrm.Utility.getGlobalContext().userSettings.roles which … Continue reading D365 CE: Get Logged in User’s Security Roles using JavaScript

D365 CE: Show/Hide and Enable/Disable same field placed in multiple tabs using JavaScript

We often put the same fields in different tabs based on business requirements. To Hide/Show such fields we need to use below script: var formContext = executionContext.getFormContext(); formContext.getAttribute("fieldName").controls.forEach( function (control, i) { ¬† ¬† ¬†control.setVisible(false/true); }); Similarly, to Enable/Disable such fields we need to use below script: formContext.getAttribute("fieldName").controls.forEach( function (control, i) { control.setDisabled(false/true); }); Without … Continue reading D365 CE: Show/Hide and Enable/Disable same field placed in multiple tabs using JavaScript