MobileCRM.UI.EntityList.requestObject - Resconet/JSBridge GitHub Wiki
Requests the EntityList object.
Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of EntityList object. See MobileCRM.Bridge.requestObject for further details.
Argument | Type | Description |
---|---|---|
callback | function(entityList) | The callback function that is called asynchronously with serialized EntityList object as argument See MobileCRM.UI.EntityList for further details.. 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.EntityList object. It selects the first list record and runs the first available button command on that record.
MobileCRM.UI.EntityList.requestObject(function (entityList) {
/// <param name='entityList' type='MobileCRM.UI.EntityList'>
var listView = entityList.listView;
// Select the first record.
listView.selectedIndex = 0;
// Take the first button (if any).
var button = entityList.listButtons[0];
if (button) {
MobileCRM.bridge.alert("button '" + button + "' was clicked.");
MobileCRM.UI.EntityList.runCommand(button); // Run its command.
}
}, MobileCRM.bridge.alert, null);