Skip to content

MobileCRM.UI.EntityForm.requestObject

rescocrm edited this page May 15, 2023 · 9 revisions

Requests the managed EntityForm object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of EntityForm object. See MobileCRM.Bridge.requestObject for further details.

Arguments

Argument Type Description
callback function(entityForm) The callback function that is called asynchronously with serialized EntityForm object as argument. Callback should return true to apply changed properties.
errorCallback function(errorMsg) The errorCallback which is called in case of error.
scope Object The scope for callbacks.

This example demonstrates how to obtain and modify MobileCRM.UI.EntityForm object. It sets the form caption to the primary name of currently edited entity

MobileCRM.UI.EntityForm.requestObject(function (entityForm) {
	/// <param name="entityForm" type="MobileCRM.UI.EntityForm"/>
	// Get the MobileCRM.DynamicEntity which is being edited on this form
	var entity = entityForm.entity;
	// Get the form control object
	var form = entityForm.form;
	// Set the form caption to the primary name of currently edited entity
	form.caption = entity.primaryName;
	// Return true to apply changed value.
	return true;
}, function (err) {
	MobileCRM.bridge.alert("An error occurred: " + err);
}, null);
Clone this wiki locally