Skip to content

MobileCRM.UI._DetailView.updateComboItemDataSource

rescocrm edited this page May 15, 2023 · 9 revisions

[v9.1] Changes the data source for CombobBoxitem MobileCRM.UI.DetailViewItems.ComboBoxItem.

Arguments

Argument Type Description
index Number Item index on the view.
listDataSource Object The data source object (e.g. {"label1":1, "label2":2}).
valueType String Type of list data source element value. Default is string, allowed int, string.
defaultValue String New data source default value. If not defined, the first item from listDataSource will be used.

This example demonstrates how to change the data source of a custom combo box item. Refer to MobileCRM.UI.DetailViewItems.ComboBoxItem object to see how to create a custom combo-box item.

function updateCustomComboboxSource(name) {
	MobileCRM.UI.EntityForm.requestObject(function (entityForm) {
		/// <param name='entityForm' type='MobileCRM.UI.EntityForm'/>
		var detailView = entityForm.getDetailView("General");
		var itemIndex = detailView.getItemIndex(name);
		if (itemIndex >= 0)
			detailView.updateComboItemDataSource(itemIndex, { "New Option 1": "1", "New Option 2": "2" });
	}, true, null);
}
Clone this wiki locally