Skip to content

MobileCRM.UI._DetailView.updateLinkItemViews

rescocrm edited this page May 15, 2023 · 9 revisions

[v10.1] Changes the ComboBoxItem views and/or filters.

Arguments

Argument Type Description
index Number Item index on the view.
dialogSetup MobileCRM.UI.DetailViewItems.LookupSetup Lookup setup for modal lookup dialog.
inlinePickSetup MobileCRM.UI.DetailViewItems.LookupSetup Optional setup for inline lookup picker. Leave empty to use the same setup as modal dialog.

This example demonstrates how change the view for the detail view link item. It sets the view or fetch XML for ParentCustomer field on Contact entity.

MobileCRM.UI.EntityForm.requestObject(function (entityForm) {
	/// <param name="entityForm" type="MobileCRM.UI.EntityForm"/>
	// Take detail view with name "General"
	var dv = entityForm.getDetailView("General");
	var inlineSetup = new MobileCRM.UI.DetailViewItems.LookupSetup();
	// Set Account entity view with name "ContactParents" defining the filter for accounts
	// that should be present in the inline lookup for this field.
	inlineSetup.addView("account", "ContactParents", true);
	// Alternatively, specify the explicit fetch XML filter for inline lookup 
	// inlineSetup.addFilter("account", '<fetch version="1.0"><entity name="account">...</entity></fetch>');
	var dialogSetup = new MobileCRM.UI.DetailViewItems.LookupSetup();
	// Set "Default" view for expanded lookup form
	dialogSetup.addView("account", "Default", true);
	//dialogSetup.addFilter("account", '<fetch version="1.0"><entity name="account">...</entity></fetch>');
	var dialogOnly = false; // Allow both inline lookup and expanded lookup dialog
	dv.updateLinkItemViews(0, dialogSetup, inlineSetup, dialogOnly);
}, onError, null);
function onError(error) {
	/// <param name="error" type="String"/>
	if (error)
		MobileCRM.bridge.alert(error);
}
Clone this wiki locally