web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

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.

(0) ShareShare
ReportReport
Posted on by 507

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.

I have the same question (0)
  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at

    Have you registered the App on the Azure portal to access the environment?

    For your understanding sharing one link

    d365technext.blogspot.com/.../dynamics-365-finance-operation-webapi.html

  • Huggins Mafigu Profile Picture
    507 on at

    Hi Sheikh,

    The App is already registered. I am currently using it to do other requests successfully. But on OData Actions is where I can't pull through.

  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at

    Hi,

    There is an issue with the Extension class, please try with the below code.

    [ExtensionOf(dataentityviewstr(PurchPurchaseOrderHeaderV2Entity))]

    final class PurchPurchaseOrderHeaderEntity_Extension

    {

  • AnithaEswaran Profile Picture
    2,032 on at

    Hi,

    OData actions doesnt give proper response when it is defined on a data entity extension.  

    Can you create a simple custom data entity and bring the code in your new one .

    Regards,

    Anitha.E

  • Huggins Mafigu Profile Picture
    507 on at
    [quote user="AnithaEswaran"]

    Hi,

    OData actions doesnt give proper response when it is defined on a data entity extension.  

    Can you create a simple custom data entity and bring the code in your new one .

    Regards,

    Anitha.E

    [/quote]

    Hi AnithaEswaran,

    The response remains the same after creating a separate entity for that.

  • Huggins Mafigu Profile Picture
    507 on at
    [quote user="Sheikh Sohail"]

    Hi,

    There is an issue with the Extension class, please try with the below code.

    [ExtensionOf(dataentityviewstr(PurchPurchaseOrderHeaderV2Entity))]

    final class PurchPurchaseOrderHeaderEntity_Extension

    {

    [/quote]

    Hi Sheik,

    The response remains the same even after creating a separate entity for that

  • AnithaEswaran Profile Picture
    2,032 on at

    Try a GET to get the details of the metaData.

    https://url/data/$metadata

    Execute this is Postman using GET . In the result tab, search for your method 'getConfirmPurchaseOrder'

    If you dont see this method in your result, there is some issue in the code . Revisit your code and do a sync again.

    Refer my post anithasantosh.wordpress.com/.../

  • Verified answer
    Huggins Mafigu Profile Picture
    507 on at

    I'm finally out of the woods. I did build the model and synced the db. From that I did a metadata request https://[root url/data/$metadata which took a bit more time to return the response, maybe because it wasn't cached as yet. In the response body I did Ctrl F and then typed my action name which is my method, and found it. I then did a normal POST request as follows 

    https://test1.cloudax.dynamics.com/data/[Custom entity name]/Microsoft.Dynamics.DataEntities.getConfirmPurchaseOrder
    
    Body here:
    
    {
        "dataAreaId": "xxxx",
        "purchId": "xxx-xxx-xxxx"
    }

    And finally it went through. So, I'm suspecting there was a synchronization issue with the AOS.

    Thank you family.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans