MobileCRM.UI.EntityForm.DetailCollection.get - Resconet/JSBridge GitHub Wiki
Asynchronously returns requested sales entity detail (e.g. Order detail)
Argument | Type | Description |
---|---|---|
index | Number | An index of requested item. |
callback | function(MobileCRM.DynamicEntity) | The callback function that is called asynchronously with the MobileCRM.DynamicEntity object as argument. |
errorCallback | function(errorMsg) | The errorCallback which is called in case of error. |
scope | Object | The scope for callbacks. |
This example demonstrates how to update the order detail quantity.
function increaseQuantity(orderDetailIndex, increment) {
MobileCRM.UI.EntityForm.DetailCollection.get(orderDetailIndex, function (detail) {
/// <param name="detail" type="MobileCRM.DynamicEntity"/>
// work with numbers, not strings!
detail.properties["quantity"] = new Number(detail.properties["quantity"]) + new Number(increment);
// Update the SalesOrderDetail entity in order details collection
detail.update();
}, MobileCRM.bridge.alert);
}