执行多个请求xrm sdk

时间:2017-05-04 09:24:45

标签: c# ssis dynamics-crm crm

我创建了一个SSIS包,用于将数据从excel文件导入CRM,目前正在使用ExecuteMultipleRequest批量发送数据到crm。这里的场景是,当我批量创建800条记录的创建请​​求时,有没有办法找回800创建的guid?如果是的话,我会以相同的顺序取回指针吗?

var multipleRequest = new ExecuteMultipleRequest()
            {
                Settings = new ExecuteMultipleSettings()
                {
                    ContinueOnError = true, // Continue, if processing of a single request fails
                    ReturnResponses = true // Return responses so you can get processing results
                },
                Requests = new OrganizationRequestCollection()
            };

            // Build a CreateRequest for each record
            foreach (var samples in _samples)
            {
                CreateRequest reqCreate = new CreateRequest();
                reqCreate.Target = geocode;
                multipleRequest.Requests.Add(reqCreate);
            }

            ExecuteMultipleResponse multipleResponses = (ExecuteMultipleResponse)Service.Execute(multipleRequest);

我现在使用此代码处理多个请求。

谢谢

0 个答案:

没有答案