I'm new to Dymanics CRM development and having a question for the community. I have a request to make the fields on the phone call activity form validate only if the "Mark Complete" button is clicked. The validation should not fire for "Save and Close".
The way the validation is implemented right now, it registers a function on the Form OnLoad event that sets the required level using javascript for the fields that require validation.
The function looks something like this:
function updateRequirementLevel() {
var level = arguments[0];
for (var i = 1; i < arguments.length; i++) {
var attribute = Xrm.Page.data.entity.attributes.get(arguments[i]);
attribute.setRequiredLevel(level);
}
}
Is there any way I could intercept the "Mark Complete" and "Save and Close" events on the client side? Or what is the right approach to implement a request like this?
Would really appreciate if someone could provide me some guiding.