Home » Microsoft TechnologiesRSS

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

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.

 

3 Answers Found

 

Answer 1

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?
 

Answer 2

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.

 

Answer 3

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

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter