-
Notifications
You must be signed in to change notification settings - Fork 26
MobileCRM.UI.DetailViewItems.NumericItem.constructor
rescocrm edited this page May 15, 2023
·
9 revisions
Constructs an instance of MobileCRM.UI.DetailViewItems.NumericItem object.
Argument | Type | Description |
---|---|---|
name | String | Defines the item name. |
label | String | Defines the item label. |
This example demonstrates how to get detail view and create new NumericItem.
MobileCRM.UI.EntityForm.requestObject(function (entityForm) {
var detailView = entityForm.getDetailView("General");
var item = detailView.getItemByName("Length");
if (item)
item.value = 55.333;
else {
item = new MobileCRM.UI.DetailViewItems.NumericItem("Length", "Length in meters");
item.decimalPlaces = 2;
item.value = 55.333;
detailView.insertItem(item, -1); // Place the item as the last one.
}
}, MobileCRM.bridge.alert, null);
MobileCRM.UI.EntityForm.onChange(function (entityForm) {
if (entityForm.context.changedItem == "Length") {
var detailView = entityForm.getDetailView("General");
var item = detailView.getItemByName("Length");
MobileCRM.bridge.alert(item.value); // Show an alert with changed length
}
}, MobileCRM.bridge.alert, null);