Hi all,
I'm new to Data Integration API's - OData in D365FO. I want to be able to call the OData Action on this endpoint and perform the necessary logic. For that I have created an OData action on PurchPurchaseOrderHeaderV2Entity as shown below and build and sync:
[ExtensionOf(tableStr(PurchPurchaseOrderHeaderV2Entity))]
final class PurchPurchaseOrderHeaderEntity_Extension
{
[SysODataActionAttribute("getConfirmPurchaseOrder",false)]
public static boolean getConfirmPurchaseOrder( DataAreaId dataAreaId, PurchId purchId)
{
boolean _response;
changecompany(dataAreaId)
{
try
{
//logic here
}
catch(Exception::Error)
{
error("Failed");
}
}
return _response;
}
}
And now I'm calling the url endpoint as shown below using Postman tool:
POST https://test1.cloudax.dynamics.com/data/PurchaseOrderHeadersV2/Microsoft.Dynamics.DataEntities.getConfirmPurchaseOrder
Body here:
{
"dataAreaId": "xxxx",
"purchId": "xxxx-xx-xxxxx"
}
But, after I run this request I get the below error message:
{
"Message": "No HTTP resource was found that matches the request URI 'https://test1.cloudax.dynamics.com/data/PurchaseOrderHeadersV2/Microsoft.Dynamics.DataEntities.getConfirmPurchaseOrder'. No route data was found for this request."
}
Can anyone please help me understand where I'm going wrong. Any help to resolve this is appreciated.