Here is a JavaScript method to remove non-alphanumeric
character and can be called on save event in Dynamic CRM
function OnSaveRemoveCharacter(executionContext)
{
formContext =
executionContext.getFormContext();
var alphaNumericChar = formContext.getAttribute("new_textfield").getValue();
// I have replaced here with space , you
can do without space like ''
alphaNumericChar =
alphaNumericCode.replace(/[^a-z0-9+]+/gi, ' ');
formContext.getAttribute("new_textfield").setValue(alphaNumericCode);
// Set field setsubmit mode
formContext.getAttribute("new_textfield").setSubmitMode("always");
}
No comments:
Post a Comment