CRM 2013 Check if all mandatory fields are populated with JavaScript

Today I needed to check if all fields on a given form were populated, as I didn’t know exactly which fields would be mandatory at any one time I need something that dynamically searched the form for all mandatory fields and checked to see if they had a value.

Fortunately this is actually pretty straight forward.

/**
Checks if all the mandatory fields are populated.

@method MandatoryPopulated
@return {bool} True if all fields are populated
**/
MandatoryPopulated: function() {
	populated = true;

	Xrm.Page.getAttribute(function (attribute, index) {
		if (attribute.getRequiredLevel() == "required") {
			if(attribute.getValue() === null) {
				populated = false;
			}
		}
	});
	
	return populated;
},
Advertisements

CRM 2013 Diagnosing “Access Is Denied” using Fiddler

I recently had to diagnose a CRM 2013 “Access Is Denied” message, back in the world of CRM 2011 this was pretty straight forward. CRM would present an option to download a log file and the log invariably pointed me in the right direction.

However I’ve found that CRM 2013 no longer presents the same option to download the log, you just get the generic error message with no further detailed information. As I was using CRM Online I was unable to check the server logs myself and I didn’t have time to contact Microsoft support.

Untitled

Continue reading