Skip to content

MobileCRM.UI.FormManager.showEditDialog

rescocrm edited this page May 15, 2023 · 9 revisions

Shows an entity edit dialog.

Arguments

Argument Type Description
entityName String The entity name.
id String GUID of the existing entity or null for new one.
relationship MobileCRM.RelationShip The optional relationship with a parent entity.
options Object A JSON object containing a form-specific properties like pre-defined field values, peer iFrame options or document options.

This example demonstrates how to open active account detail form.

function openAccountEditDetail() {
	var account = new MobileCRM.FetchXml.Entity("account");
	account.addAttribute("accountid");
	// only active record can have edit form
	account.filter = new MobileCRM.FetchXml.Filter();
	account.filter.where("statecode", "eq", "0");
	// only one record will be fetched
	var fetch = new MobileCRM.FetchXml.Fetch(account, 1);
	fetch.execute("Array", // Take the results as an array of arrays with field values
	function (res) {
		MobileCRM.UI.FormManager.showEditDialog("account", res[0][0], null);
	}, MobileCRM.bridge.alert);
}

Clone this wiki locally