Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Link & D-link the records in subgrid through javascript

Posted on by 15

Link & D-link the records in subgrid through javascript

*This post is locked for comments

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Link & D-link the records in subgrid through javascript

    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:

    pravinpawarweb.wordpress.com/.../

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    Kalpavruksh D365 CoE 2,545 on at
    RE: Link & D-link the records in subgrid through javascript

    Hi Amit,

    If you are referring to associate and disassociate the record using javascript please refer this link: http://himbap.com/blog/?p=2063
    Also, can you please provide more details on your requirement, so we can help you better. pastedimage1562665466768v1.png
  • Saad Kabarousse Profile Picture
    Saad Kabarousse 732 on at
    RE: Link & D-link the records in subgrid through javascript

    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:

    github.com/.../CRMRESTBuilder

    Hope this will help :)

    If this answered your question, please make sure to Mark this as an Answer.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans