I want to fill in the name field for a custom entity in Microsoft Dynamics CRM 2011. I wrote a function that will be triggered in the onsave trigger for this entity.
This function works perfect when this field is not required. But they want this field to be business required. So when i try to save a new record, i get a message that this field must be filled in. Which means my onsave function is never called.
here's my code that is called when saving the record:
var ls_string = "";
// put some text in ls_string
var myName = "";
if (myName != Xrm.Page.getAttribute("name").getValue()) {
Xrm.Page.getAttribute("name").setValue(ls_string);
Xrm.Page.getAttribute("name").setSubmitMode("always");
}