目前,我正试图编写测试动态CRM应用程序使用假XRM容易。这段代码给了我一个错误。
var executeMultiple = new ExecuteMultipleRequest
{
Settings = new ExecuteMultipleSettings
{
ContinueOnError = true,
ReturnResponses = true
},
Requests = new OrganizationRequestCollection()
};
executeMultiple.Requests.AddRange(this.requestBag.Select(x => x.request));
try
{
var batchResponse = (ExecuteMultipleResponse)this.orgService.Execute(executeMultiple);
foreach (var response in batchResponse.Responses)
{
this.requestsPerformedByServiceCounter++;
this.OnResponseReceived(new ResponseReceivedEventArgs
{
Fault = response.Fault,
RequestIndex = response.RequestIndex,
Response = response.Response,
Request = this.requestBag[response.RequestIndex].request,
Identifier = this.requestBag[response.RequestIndex].identifier,
TotalRequestsPerformed = this.requestsPerformedByServiceCounter,
});
}
this.requestBag.Clear();此方法正在调用上级方法。
foreach (var company in this.companies)
{
EntityReference existedAccountRef = null;
if (!string.IsNullOrEmpty(company.id.ToString()))
{
var existedAccount = this.crmService.IsCompanyExistInCrm(company.id);
existedAccountRef = existedAccount != null ? existedAccount.ToEntityReference() : null;
}
if (existedAccountRef != null)
{
bulkExecutionService.Update(new Account()
{
AccountId = existedAccountRef.Id,
Name = company.name,
odx_Bank_Account_Number = company.bank_account_number,
// odx_Company_share_Capital = company.company_share_capital, todo
odx_Is_Foreign = company.is_foreign,
odx_KRS = company.krs,
odx_Legal_form = company.legal_form,
odx_NIP = company.nip,
odx_Paynow_Created_at = company.created_at,
odx_Paynow_Modified_at = company.modified_at,
odx_PaynowID = company.id,
odx_pkd = company.pkd,
odx_regon = company.regon,
odx_Vat_EU = company.vat_eu
}, company.id);
}
else
{
bulkExecutionService.Create(new Account()
{
Name = company.name,
odx_Bank_Account_Number = company.bank_account_number,
// odx_Company_share_Capital = company.company_share_capital, todo
odx_Is_Foreign = company.is_foreign,
odx_KRS = company.krs,
odx_Legal_form = company.legal_form,
odx_NIP = company.nip,
odx_Paynow_Created_at = company.created_at,
odx_Paynow_Modified_at = company.modified_at,
odx_PaynowID = company.id,
odx_pkd = company.pkd,
odx_regon = company.regon,
odx_Vat_EU = company.vat_eu
}, company.id);
}
}
bulkExecutionService.FinalizeExecutor();我所遇到的错误就在这一行:
var batchResponse = (ExecuteMultipleResponse)this.orgService.Execute(executeMultiple);FakeXrmEasy.Abstractions.Exceptions.PullRequestException:的例外:还不支持组织请求类型'Microsoft.Xrm.Sdk.Messages.ExecuteMultipleRequest‘.
老实说,我不知道我能用它做什么。
发布于 2022-01-27 21:41:57
你试过安装FakeXrmEasy.Messages软件包了吗?
FakeXrmEasy v2或更高版本现在使用模块化架构。
创建、检索、更新、删除、向上插入、关联消息或Dissasociate消息位于FakeXrmEasy.Core包中,但其他消息现在位于该专用FakeXrmEasy.Messages包中。
编辑:安装消息包后,还请添加对中间件设置中的假消息执行器之一的引用,如下所示:
.AddFakeMessageExecutors(Assembly.GetAssembly(typeof(AddListMembersListRequestExecutor)))这将使用反射查找任何其他虚假消息。如果您在自己的程序集中有自己的消息,可以任意多次调用该方法。这是可能的,因为2.1.x和3.1.x版本。
请查看这里的发布说明:
https://dynamicsvalue.github.io/fake-xrm-easy-docs/releases/2x/2.1.1/
https://stackoverflow.com/questions/70862663
复制相似问题