Does ExecuteMultipleRequest return more than just the IDs of bulk inserted records? RRS feed

  • Question

  • I have some code which inserts some Appointments into CRM. 

    I do this in a loop so I know which records I am dealing with and am able to send the Appointment details and the GUID back to the calling web site quite easily.

    I would like to use ExecuteMultipleRequest instead.

    The problem:

    Currently I have the details of the appointments before the INSERT.  I know which GUID goes with which Appointment. 

    In ExecuteMultipleRequest method I am not looping so can't be sure which Appointment maps to which GUID.

    Ideally the Appointment objects are stored in the response so I can get them easily.  Are they?

    If they are not (and maybe to keep the object small they are not) how can I match the new GUIDs with the Appointments I passed into request.  I am guessing they are in the same order but that seems a little dodgy to me.  I also don't want to do a query to CRM as I am trying to improve performance.

    Friday, March 27, 2015 6:01 PM

All replies

  • Hi Gordon,

    I am not sure what you mean by "which appointment maps to which GUID". I suppose you retrieve the GUID of the created Appointment from the result of the create request. This is what you want to achieve using ExecuteMultipleRequest too, right?

    When using ExecuteMultipleRequest you have the option to set ReturnResponses = true which gives you the possibility to iterate through the responses and retrieve the required GUIDs.

    I hope this helps.


    Btw.: In case you work with CRM Online, there is a maximum record batch size for bulk insert/update.
    • Edited by [HH]Rob Monday, March 30, 2015 3:14 PM CRM Onlie Batch Size
    Monday, March 30, 2015 3:04 PM