Hide “+” and “See Associated records” buttons in subgrid based on value of a field

Create a web resource with a simple JavaScript method that will return true or false depending on the value that you want to validate, find below an example: Create a new solution with only the Entity that you want to customize (The entity of the subgrid).Open XRM Toolbox -> Ribbon Workbench.Open the Solution created in … Continue reading Hide “+” and “See Associated records” buttons in subgrid based on value of a field

Advertisements

ClientGlobalContext.js.aspx:1 Failed to load resource: the server responded with a status of 404 ()

After creating a new HTML web resource for our MS Dynamics CRM 365 instance, I started to get the next error: ClientGlobalContext.js.aspx:1 Failed to load resource: the server responded with a status of 404 () Found that my reference to this file was incorrect and here is how it should be: <script type="text/javascript" src="../WebResources/ClientGlobalContext.js.aspx"></script> Hope … Continue reading ClientGlobalContext.js.aspx:1 Failed to load resource: the server responded with a status of 404 ()

OptionSet fields and Javascript – Dynamics CRM

In order to get and set values in an OptionSet field in JavaScript, use the code below: // Get Option Set var Option_Set = Xrm.Page.data.entity.attributes.get("FieldName"); // Get Option Set / Selected Option var OptionSet_Selcted_Option = Xrm.Page.data.entity.attributes.get("FieldName").getValue(); // Get Option Set / Options var OptionSet_Options = Xrm.Page.data.entity.attributes.get("FieldName").getOptions(); // Get Option Set / Label text var OptionSet_Label_Text … Continue reading OptionSet fields and Javascript – Dynamics CRM

Get, Set and Update fields with JavaScript – Dynamics CRM

Usually it's required to get, update or change fields dynamically with JavaScript. Find below some easy methods to achieve some of these necessities // Get Field var Field = Xrm.Page.data.entity.attributes.get("FIELD_NAME"); // Get Field value var Field_Value = Xrm.Page.data.entity.attributes.get("FIELD_NAME").getValue(); // Set Field Value (String) var Field_Value = Xrm.Page.data.entity.attributes.get("FIELD_NAME").setValue("HELLO WORLD"); // Set Field Label Xrm.Page.ui.controls.get("FIELD_NAME").setLabel("EXAMPLE");