Hi All,
I am trying to call Custom D365FO REST web service using client-id and ClientSecret in Logic App (i.e. HTTP Post). The web service executed the operation in the Default user context. I know that in the Soap version it is possible to switch the context/Company using AX.CallContext callContext = new AX.CallContext() { Company = "XXXX" }. Which in turn generates
<s:Header><h:CallContext xmlns:h="">schemas.microsoft.com/.../datacontracts" xmlns:i="">www.w3.org/.../h:Company><h:Language i:nil="true"/><h:MessageId i:nil="true"/><h:PartitionKey i:nil="true"/></h:CallContext></s:Header>
I would like to achieve the same in REST endpoint of this webservice.
I tried the following:
1. Added the call context in Body of the request
"CallContext": {
"Company": "XXXX"
},
"Company": "XXXX"
},
2. Added CallContext in the header
Nothing seems to work. Can someone advise how to switch the context?
Note: I don't want to add Company in data contract and then code does the company switching