-
Notifications
You must be signed in to change notification settings - Fork 26
MobileCRM.ManyToManyReference.create
rescocrm edited this page May 15, 2023
·
9 revisions
Creates a new N-N relationship between the two passed entities.
New relationship is created either in local database or using the online request. It depends on current application mode.
Argument | Type | Description |
---|---|---|
entityName | String | The relationship entity name. |
ref1 | MobileCRM.Reference | First entity instance. |
ref2 | MobileCRM.Reference | Second entity instance. |
success | function(result) | A callback function for successful asynchronous result. |
failed | function(error) | A callback function for command failure. The error argument will carry the error message. |
scope | A scope for calling the callbacks; set "null" to call the callbacks in global scope. |
This example demonstrates how to create a new N-N relationship between competitor and product entities.
var competitor = new MobileCRM.Reference("competitor", competitorid);
var product = new MobileCRM.Reference("product", productid);
MobileCRM.ManyToManyReference.create("competitorproduct", competitor, product, function () { onCreated(); }, function (err) { showError(err); });