You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rescocrm edited this page May 15, 2023
·
1 revision
[v10.0] Appends the product into sales order collection.
Resulting MobileCRM.DynamicEntity object implements method "update" which can be used to update the entity properties in the sales detail collection.
Arguments
Argument
Type
Description
product
MobileCRM.Reference
A reference of the product to be appended.
quantity
Number
Product quantity.
This example demonstrates how to add a new product with given quantity into order details.
// WARNING: async/await pattern requires ECMAScript 6 and it's not supported on Internet Explorer.// It's supported by all modern browsers including mobile version of Chrome and Safari (requires Android 5+ and iOS 10+).functionaddNewProduct(productId,quantity){return__awaiter(this,void0,void0,function*(){try{varproductRef=newMobileCRM.Reference("product",productId);varorderDetail=yieldMobileCRM.UI.EntityForm.DetailCollection.addAsync(productRef,quantity);MobileCRM.bridge.alert("Product added");}catch(err){MobileCRM.bridge.alert(err);}});}