Skip to content

MobileCRM.UI.ViewDefinition.loadEntityViews

rescocrm edited this page May 15, 2023 · 9 revisions

Asynchronously loads all view definitions for given entity.

Arguments

Argument Type Description
entityName String The entity name.
callback function(viewDefArray) The callback function which is called asynchronously. Callback will obtain an array of ViewDefinition objects.
errorCallback function(errorMsg) The errorCallback which is called asynchronously in case of error.
scope Object The scope for callbacks.

This example demonstrates how to load entity existing views.

function loadViews(entityName) {
	MobileCRM.UI.ViewDefinition.loadEntityViews(entityName, function (views) {
		/// <param name="views" type="Array"/>
		if (views != undefined && views.length > 0) {
			var viewNames = "";
			for (var i in views) {
				viewNames += views[i].name;
			}
			MobileCRM.bridge.alert(viewNames);
		}
	}, MobileCRM.bridge.alert, null);
}
Clone this wiki locally