locked
C# Delete vs Database trigger delete in Ms Crm RRS feed

  • Question

  • Hello guys ,

    Database design :

    Main Entity : Customer
    Related Child Entity : Phonenumber

    Business Sceanrio :

    Our business uses ui to show customer details and list of phone no.

    User can add as many phone nos as he wishes to.
    If user want to delete existing phone and add new ones , he can.
    Also user can modify other details like date of birth , first name present on Customer form.

    This data is linked to Ms Crm Databse so customer is parent entity and phone no is associated child entity.

    Requirement :

    Old Phone no list : 11 , 22 , 33 , 44 

    When update is fired on customer , Delete all Phonenumbers

    After update on Customer:
    There will be no phonenumber linked to that customer

    Approach 1 :

    Write Delete code in c# when you update customer

    Approach 2 :

    Write trigger on customer update in sql to delete all associated phone no

    Regards ,
    Om
    Friday, August 8, 2014 3:22 PM

All replies

  • Approach 1 is supported, approach 2 is not supported. Seems like a simple choice to me

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Friday, August 8, 2014 4:22 PM
    Moderator