Link & D-link the records in subgrid through javascript
*This post is locked for comments
Link & D-link the records in subgrid through javascript
*This post is locked for comments
Hi Amit,
Do you mean to say that those entities having N-N relationship ?
If yes then use associate and dissociate requests to link and d-link subgrid records as mentioned in below blog:
lucianodangelo.blogspot.com/.../crm-2016-web-api-operations.html
If its 1-N relationship then you need to use create and delete request.
Please refer below url for reference:
Hi Amit,
In this Example i'll use relation between Incident and PhoneCall which is Many To Many. which i guess is the case for you too.
Use this for the Associate Request:
SDK.REST.associateRecords("9CBCF511-3B9E-E911-80EB-001DD8B71CF5", "Incident", "Incident_Phonecalls", "9CBCF511-3B9E-E911-80EB-001DD8B71CF5", "PhoneCall", function() {
//Success - No Return Data - Do Something
}, function(error) {
Xrm.Utility.alertDialog(error.message);
});
and this for the dissssociate request:
SDK.REST.disassociateRecords("9CBCF511-3B9E-E911-80EB-001DD8B71CF5", "Incident", "Incident_Phonecalls", "9CBCF511-3B9E-E911-80EB-001DD8B71CF5", function() {
//Success - No Return Data - Do Something
}, function(error) {
Xrm.Utility.alertDialog(error.message);
});
you can use the Crm Rest Builder Solution to Build all of your javascript requests:
Hope this will help :)
If this answered your question, please make sure to Mark this as an Answer.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156