【问题标题】:Dynamics CRM + Execute requests in parallelDynamics CRM + 并行执行请求
【发布时间】:2021-06-21 03:40:36
【问题描述】:

我有一个复杂的 azure 函数,它在检查多个条件的同时在 dataverse 的表中创建/更新大约 400 条记录

我正在使用 ExecuteTransactionRequest 创建/更新记录,执行逻辑大约需要 15 秒。有没有办法让它更快,在执行事务中引入并行处理?

【问题讨论】:

    标签: dynamics-crm dynamics-crm-online


    【解决方案1】:

    我不确定我的答案是否适用于你的场景,但我会提到它以供参考。

    WebApi 接受批量请求,从而为您节省顺序和并发请求的延迟时间。一个包含多个内部请求的请求被发送一次到 api 并且将立即在其服务器上运行并返回结果。

    也就是说,如果您使用 WebApi 而不是使用连接器与 CDS 进行通信。

    如果是这样,请参考以下示例发布2种货币并获取全部:

    --batch_ABC123
    Content-Type: multipart/mixed; boundary=changeset_ABC111
    
    --changeset_ABC111
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    
    POST YOUR-RESOURCE_URL/api/data/v9.1/transactioncurrencies HTTP/1.1
    Content-ID: 1
    Accept: application/json;
    Content-Type: application/json;type=entry
    
    {"currencyname": "Dansk Krona1","currencysymbol": "$","isocurrencycode": "PPV","exchangerate": 0.90}
    
    --changeset_ABC111
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    
    POST YOUR-RESOURCE_URL/api/data/v9.1/transactioncurrencies HTTP/1.1
    Content-ID: 2
    Accept: application/json;
    Content-Type: application/json;type=entry
    
    {"currencyname": "Dansk Krona2","currencysymbol": "$","isocurrencycode": "UPV","exchangerate": 0.90}
    --changeset_ABC111--
    
    --batch_ABC123
    Content-Type: application/http
    Content-Transfer-Encoding:binary
    
    GET YOUR-RESOURCE_URL/api/data/v9.1/transactioncurrencies HTTP/1.1
    Accept: application/json
    
    --batch_ABC123--
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多