Category Archives: MS CRM & Javascript

Implementing Reason for Delete in D365 CE

Requirement In Dynamics 365 Customer Engagement (CE), managing data is crucial for maintaining a clean and efficient database. When we delete records, out of the box auditing feature can help to see audit information of the deleted record but what if we want to see the reason why this record was deleted?. With a simple customization, we can implement this… Read more »

Check Parent Entity Name From Child entity form D365 CE

Requirement Add validation on child entity form based on parent entity. Details Sometimes we want to check name of the parent entity in the child entity quick create form for validation. We can use JavaScript for this validation. For the demo let’s say when someone will try to create contact record from subgrid under Account we want to display a… Read more »

Implementing Prompt dialog in D365 CE Part 2

Requirements Let’s say we have requirement where user can put opportunity on hold but before doing he needs to enter comment which should be saved in the opportunity. In the earlier part we discussed of creating prompt and updating opportunity, in this part we will discuss next items. Details We have our prompt page ready now we need to create… Read more »

Get Max value using Javascript

 If you want to fetch Max value from CRM entity record using Javascript, you can use below code, remember to change entity and field name accordingly var authenticationHeader = GenerateAuthenticationHeader(); // Prepare the SOAP message. var xml = “<?xml version=’1.0′ encoding=’utf-8′?>”+ “<soap:Envelope xmlns:soap=’http://schemas.xmlsoap.org/soap/envelope/’”+ ” xmlns:xsi=’http://www.w3.org/2001/XMLSchema-instance’”+ ” xmlns:xsd=’http://www.w3.org/2001/XMLSchema’>”+ authenticationHeader+ “<soap:Body>”+ “<RetrieveMultiple xmlns=’http://schemas.microsoft.com/crm/2007/WebServices’>”+ “<query xmlns:q1=’http://schemas.microsoft.com/crm/2006/Query’”+ ” xsi:type=’q1:QueryExpression’>”+ “<q1:EntityName>EntityName</q1:EntityName>”+ //change entity name “<q1:ColumnSet… Read more »

"This control only accepts strings or null as input" error message

when you will try to assign integer value to nvarchar attribute in MS CRM like below var IntVal=10; Let’s say we have one field named “ABC” having nvarchar datatype crmForm.all.ABC.DataValue=IntVal; you will get error “This control only accepts strings or null as input”. to solve this issue you can use toString() method of JS like below crmForm.all.ABC.DataValue=IntVal.toString(); Enjoy !!!

Change CRM Field and Section Label at Runtime

Some time we need to change CRM field label at runtime. This can be easily implemented through JS code. You can change like below crmForm.all.FieldName_c.innerText=”New Label”; you can include this code on any form event based on your requirement. I got one question on CRM Forum where user need to change CRM field label at runtime based on Picklist value. For… Read more »

Hide MS CRM 4.0 Grid Button

I am regular visitor of ms CRM forums, I found this question many times, to hide MS CRM gird button. Which cannot be implemented through supported customization. We can implement this through unsupported customization. For example we want to hide assign button on opportunity grid toolbar. So we can do this by writing script to hide this button on Homepage.aspx… Read more »

Tooltip In CRM 4.0

As in my previous http://mahenderpal.wordpress.com/2009/12/10/tooltip-for-ms-crm-fields/ Post I have discussed how to set Tooltip for CRM Fields, I want to extend this post. Tooltip For Left Navigation Items sometimes we need to set custom tooltip for left navigation items, so we can use the same title attribute to set but for left navigation link you have to set title for child element… Read more »