MobileCRM.UI.EntityForm.DetailCollection.deleteByIndex - Resconet/JSBridge GitHub Wiki
Deletes the sales entity detail (e.g. Order detail) by index.
Arguments
Argument | Type | Description |
---|---|---|
index | Number | An index of the item to be deleted. |
callback | Function | The callback function which is called asynchronously in case of success. |
errorCallback | function(errorMsg) | The errorCallback which is called in case of error. |
scope | Object | The scope for callbacks. |
This example demonstrates how to delete a sales entity detail (e.g. OrderDetail) by index.
function deleteByIndex(index) {
MobileCRM.UI.EntityForm.DetailCollection.getAll(function (details) {
/// <param name="details" type="Array<MobileCRM.DynamicEntity>"/>
if (details[index]) {
var product = details[index];
MobileCRM.UI.EntityForm.DetailCollection.deleteByIndex(index, function () {
MobileCRM.bridge.alert("Product " + product.properties.productdescription + " successfully deleted.");
}, MobileCRM.bridge.alert);
}
else
MobileCRM.bridge.alert("Order doesn't contain any product.");
}, MobileCRM.bridge.alert);
}