locked
Can I update a group of entity attributes via code (JavaScript or C#). I have exhausted Google searches and found partial solutions. RRS feed

  • Question

  • Hi all,

    Can I update a group of entity attributes via code (JavaScript or C#).  I have exhausted Google searches and found partial solutions. Any help would be appreciated

    Gord

    Thursday, May 8, 2014 2:03 AM

All replies

  • Hi,

    you can update multiple attributes in js or c#, and CRM SDK has samples for the same as well, did you check it ?? or let me know if I am not understanding your requirement.

    http://msdn.microsoft.com/en-us/library/gg309549.aspx

    http://msdn.microsoft.com/en-us/library/gg334754.aspx


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Thursday, May 8, 2014 5:16 AM
    Moderator
  • Hi Mahender,

    Thank you for responding to my post, and sorry for not responding sooner.

    I have reviewed the links you have provided (I had taken a cursory look at them before), and working through them was useful (I spent quite some time going through the material).

    What I want to do is to select a number of records from a custom entity  (25 records or so) and then update one particular attribute of the custom entity, such that all of the selected records will have that particular attribute updated to the same value. 

      Do you have any suggestions?

    Tuesday, June 10, 2014 2:21 AM
  • Hello,

    You have multiple options for doing that, for example

    1. You could select records from CRM view and click on edit button it will allow you to edit multiple records with the same value.

    2. You could also utilize export to excel functinoality for this and can export required records set in excel,update and reimport them.

    3. You could also utilize Execute multiple request here to update multiple records in single call.

    4. You can also use Odata for this.


    Our Website| Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.


    Tuesday, June 10, 2014 4:06 AM
    Moderator
  • Hi Mahender,

    Thanks for the suggestions

    I have considered the first two options - but they are not viable:

    Option 1 does not allow selection of records spanning multiple pages - (the data selected on the current page, is discarded if the user moves to another page.)

    Option 2  would be confusing for clerks (over 100) using the system (time and training).

    Option 3: I will look at the Execute multiple requests.  

    Option 4: OData was not working for me, but it just might be where I was running it (in an HTML web resource file, embedded in a record form. I find much of CRM frustrating in that it seems to require lots of workarounds - is this just me, or is this the nature of the beast?   

    Cheers,

    Gord


    Friday, June 13, 2014 1:40 AM
  • You can create a workflow, where you can hardcode your value in workflow and use MSCRM Toolkit to run it for multiple records, Check my post for the same, I don't think you should have any issue with Odata when using in html webresource if you will see SDK you will find sample code for the same as well.


    Our Website| Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Friday, June 13, 2014 4:53 AM
    Moderator
  • Hi Gord,

    Option 1: you could increase the records shown from 50 to 250. That might help with the paging issue (a bit)

    Don

    Thursday, June 26, 2014 9:23 PM