Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Best way to check a parameter value of a parent entity and prevent save of an updated child record if the parameter value isn’t appropriate?

$
0
0

e.g. on a custom entity called project don't let the an 'activity' child entity record 'status' parameter be saved if it set to 'completed' when the start date of the associated project record is after todays date.

CRM doesn’t appear to offer this facility in the UI (e.g. business rules) so we do this via a form JavaScript onsave event. It requires a synchronous request to prevent the onsave event completing before the check takes place.

 

Our research indicates that we shouldn’t use the XMLHttpRequest method ‘This should not be used with synchronous requests‘ https://msdn.microsoft.com/en-us/library/gg334279.aspx, https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/onreadystatechange

In CRM 2011 we used $.ajax synchronous calls within a form but see that Microsoft don’t recommend this: ‘Avoid using jQuery with form scripts’ https://msdn.microsoft.com/en-us/library/hh771584.aspx.  We have migrated to Dynamics 365 on premise and are also concerned about the upcoming deprecation of the CRM 2011 endpoint and need to rewrite some code in anticipation.

Is the recommended solution to use FetchXML?

Thanks

David


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images