locked
CRM 4 Custom Entities delete not removing link but deleting the associated entity RRS feed

  • Question

  • I am using MS CRM 4 and have created two custom entities (supplier and Items) each supplier can have many items assigned to it. I have further created a 1:n relationship to facilitate this.

    The problem is when a user mistakenly assignes a wrong item(s) to a supplier and then decides to delete it/them he ends up deleting the item(s) in a cascade manner. Hence rather than a link between supplier and item(s) being removed the item itself is deleted form the Items list along with all other suppliers item is associated with,

    I have set the relationship behaviour of 1:n to Referential where delete is set to 'remove link' but this does not work as expected.

    Can you please advise how I can set-up the entities to remove the link rather then delete the item.

    • Moved by Xiaopeng Wu Tuesday, March 8, 2011 10:12 PM Forum consolidation (From:CRM Online)
    Monday, September 20, 2010 11:37 AM

Answers

  • It sounds like your users are deleting the Item record itself.  As you noted, The 1:n Referential relationship has to do with how the system reacts when a Supplier is deleted, not the Item record.

    To remove the link between a particular Item and its Supplier, your users should clear the lookup field on the Item record.  This will leave the Item in the database and remove the relationship to the Supplier.

    Thanks,

    Matt

    Monday, September 27, 2010 10:30 PM
    Moderator

All replies

  • I think you got it setup the right way between Supplier and Items as a 1:N referential.  When you remove the Supplie the items are not removed "cacade delete" as a parential relationship.  Have you tried to republish the change and then test it again?
    Follow Workopia on Twitter

    Good CRM Links: http://www.workopia.com/Links.htm
    My CRM Blog: http://microsoft-crm.spaces.live.com

    Monday, September 20, 2010 2:58 PM
    Moderator
  • Hi Frank,

    Thanks for your response. I did publish (and republish) all my changes but to no effect. Its correct, when I delete supplier then it does not delete the associated items (but also does not remove the link that appears in the lookup on the item -even through the supplier does not exist anymore)!?! -I am unsure if this is expected behaviour.

    Any other recommendations would be greatly appreciated.

    Thanks

    Hameed.

    Tuesday, September 21, 2010 8:30 AM
  • It sounds like your users are deleting the Item record itself.  As you noted, The 1:n Referential relationship has to do with how the system reacts when a Supplier is deleted, not the Item record.

    To remove the link between a particular Item and its Supplier, your users should clear the lookup field on the Item record.  This will leave the Item in the database and remove the relationship to the Supplier.

    Thanks,

    Matt

    Monday, September 27, 2010 10:30 PM
    Moderator
  • Hi Frank,

    Were you able to track why was this happening.. i am in a similar situation where when i delete the parent, the child records are not deleted but the link remains. i have tried with both Referential relationship and also Cascading Remove Link - on Delete.

    What unusual thing i notice is in the view, when i see the child record, the parent lookup column in view is shown null.. but when i open that child record, it still shows the parent link on the form in the look up. 

    Guide me if you were able to track that down. thanks..

    Teena

    Wednesday, May 18, 2011 9:02 PM