In CRM if you create an integer field by default the CRM group 2 numbers together by using a comma. This is the standard feature.
However sometimes customers ask this comma to be removed. This is not possible with OOTB functionality in CRM. You have couple of options.
• Remove the integer field, have a text field and include javascripting to validate the field. This might be cumbersome.
• Can create another field (text) and using a workflow assign the value of the integer field to this. This field would be getting displayed in views and forms. The drawback is you have synch both these fields.
• You can have a javascript to remove the comma from the CRM form when it’s loading. Not much difficult. However you still would not be able to get rid of commas when you display a view.
Below I have given a common javascript function which can be used to get rid of commas. Add this to a web resource.
function RemoveComma(fieldname)
{
document.getElementById(fieldname).value = Xrm.Page.data.entity.attributes.get(fieldname).getValue();
}
• Add the web resource to form onload event.
• Call the function RemoveComma with the field name as the parameter.
This way you can use this function anywhere you want just by passing the field name to it.
This blog describes mostly about the work (CRM 365, CRM 2016, CRM 2015, CRM2011, CRM 4.0, CRM 3.0, C#,Javascript and SQL Server) i do.
Subscribe to:
Post Comments (Atom)
Retrieving Calendar of a Bookable Resource in Dynamics
There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...
-
There is a bit of change in CRM 2011 than CRM 4. The code is below. Microsoft.Xrm.Sdk. EntityReference Moniker1 = new Microsoft.Xrm.S...
-
When you create a new security role from scratch and then assign only that role to a system user and when you log to the CRM site you might ...
-
There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...
No comments:
Post a Comment