【问题标题】:Probleme when using the PATCH method to update salesOrderLines on SAP BUSINESS ONE service layer使用 PATCH 方法更新 SAP BUSINESS ONE 服务层上的 salesOrderLines 时出现问题
【发布时间】:2020-09-17 11:23:25
【问题描述】:

这是我收到的错误消息:

Access to XMLHttpRequest at 'http://192.168.0.4:50001/b1s/v1/Orders(334738)' from origin 'http://192.168.0.4:8000' has been blocked by CORS policy: Request header field b1s-replacecollectionsonpatch is not allowed by Access-Control-Allow-Headers in preflight response.

$.ajax({
        url: GlobalLink + "Orders("+DocEntry+")",  
        
        xhrFields: { withCredentials: true  },  
        headers:  { 'B1S-ReplaceCollectionsOnPatch' :true  } ,
     
         data: jdata,   
         type: "PATCH",    
          dataType : "json",     

【问题讨论】:

    标签: service layer


    【解决方案1】:

    您必须配置服务层以允许在 CORS 请求中使用此标头。可以通过网页界面“ServiceLayerController”来完成:

    只需在此处添加标题“b1s-replacecollectionsonpatch”,用逗号分隔即可。

    【讨论】:

      猜你喜欢
      • 2020-09-08
      • 2012-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-01
      • 1970-01-01
      • 2015-10-20
      • 1970-01-01
      相关资源
      最近更新 更多