web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to Un Link record from Subgrid

(0) ShareShare
ReportReport
Posted on by 314

Hello All,

I have requirement where I have two Custom entities having 1:N relation, means If one Entity has Lookup than on the Other Entity form there will have Subgrid.  Now suppose In the subgrid I have 3 records which means subgrid Parent Entity link is provided in the three entities (Lookup field). Now I can manually open these entities remove the lookup field value one by one which is nothing but UnLinking, but can I do unlinking directly in the Subgrid??

because  now what It is showing is Delete button as soon as we hover over the record on subgrid. so when I click on delete It asks "Do you want to delete this....?" and If I click Yes It permanently delete but mine requirement is just to do Un linking at that moment? deletealert.PNG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: How to Un Link record from Subgrid

    Hi,

    You can create a on demand workflow, remove the lookup value.

    Ask user to use advanced find to filter out all the records, and run the on demand workflow.

    Less efforts compare to write a custom button and etc.

    3386.23.png

  • Suggested answer
    Preeti Sharma Profile Picture
    2,678 on at
    RE: How to Un Link record from Subgrid

    Hi,

    You can disassociate a record if there is n:n relationship between entities.

    For you case, I would suggest you to use the deactivate record feature.  sub grid view should only display active records.

    Let the user deactivate the records instead, but still can view it in another view, for example view to show all records.(with deactivated record)

    You can add custom button on grid to deactivate record and remove delete button from there.

    Hope this helps:)

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: How to Un Link record from Subgrid

    Hi Ishan,

    You are correct this is by design the delete button is to delete record not remove the association, but you want to implement this functionality you need to write custom grid where you can allow this feature.

    Or as a possible work around you can create a on demand workflow on entity in subgrid to set lookup to null in workflow for selected record and train your user to run that workflow by navigating to associated view from the button next to + (in subgrid you won't be able to select record)

    Hope it will help you

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    6,211 on at
    RE: How to Un Link record from Subgrid

    Hi Ishan,

    You need to Cascase All relationship between your entities, In this case when you delete parent record all its related records will get deleted.

    Please check below article,

    www.magnetismsolutions.com/.../Cascading_Rules_in_Microsoft_Dynamics_CRM.aspx

    Best Regards,

    Shahbaaz

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: How to Un Link record from Subgrid

    Hi Ishan,

    Yes the delete button in subgrid is basically for delete the record not remove the link.  So you need to modify the lookup value of the record instead of remove.

    If  your lookup is not business required then you simply open the record from the sub grid and update the lookup field value null or empty and update the record , so the record will exists but it will not show in the grid .

  • Verified answer
    SONU Profile Picture
    193 on at
    RE: How to Un Link record from Subgrid

    Hi Ishan,

    You might have already got to know that this is an OOB behavior of the CRM for 1:N relationships,

    so

    if its a business requirement you can add custom button in the ribbon and add function to remove the link for the grid selected record, so that user can select the record which need to be disassociated and click on the button to disassociated it.

    Additionally you can remove delete rights for the user roles to prevent deletion of records.

    Please make sure you mark it as helpful and  Mark as answer, if your question got answered.

    Thanks

    Nidheesh C P

  • Verified answer
    Ishan Sharma Profile Picture
    314 on at
    RE: How to Un Link record from Subgrid

    Hi,

    What i have done I just opened my custom entity in Ribbon Workbench. On the subgrid ribbon we can see both Delete and Remove(basically dis-associate). I Unhided the Delete button and changed the Relation Type Display Rule  of Remove Button to 1:N for my custom Entity(which was N:N). It is working :)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans