locked
Ms Crm Entity Audit when record is updated by c# RRS feed

  • Question

  • Hello guys , 

    Business Functionality : 

    Our business uses ui to show customer details 

    User can select a customer from list of customers and then modify customer details like first name , date of birth. 

    This data is linked to Ms Crm Databse so customer is an entity. 

    Requirement : 

    When user selects particular customer and edit it and then hit save : 

    Data should be saved to database ,

    But if new data = old data then modified on field and Audit history for that record should not change 

    Our Approach : 

    Our old logic is doing the following operations : 

    1. Retrieve new data

    2. Update the customer by Update(Entity) method of Crm Sdk 

    Problem with our approach : 

    Each time this method is executed , audit history of customer record changes and modified on date also changes.

    This is incorrect if New Customer Data is Same as Old Customer Details. 

    Our Requirement : 

    But we wanted to work on this and check whether this audit can be made correct. 

    Is there any other better way to achieve such update with proper audit.

     

    I would appreciate any suggestions regarding this. 

    Thanks ,

    Om

    Tuesday, August 19, 2014 12:03 PM

All replies

  • The CRM API is designed so that it is the responsibility of the calling code to determine if an attribute or entity has changed, and to only send the changes to an Update method.

    Therefore, if you have developed your own UI that updates CRM data, then your code should compare the old and previous values. It should only call the Update method if at least one value has changed, and should only send the attributes that have changed


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

    Tuesday, August 19, 2014 3:12 PM
    Moderator
  • Hi ,

    Thanks for your response.
    Sorry for late reply.
    I am looking into your suggestion

    Regards ,
    Om

    • Edited by Om Ms crm Thursday, August 21, 2014 10:34 AM
    Thursday, August 21, 2014 10:34 AM