Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

OData actions is throwing No HTTP resource was found that matches the request URI error

(1) ShareShare
ReportReport
Posted on by 300
Hello all,
 
I have created a new Odata action in an entity and tried to consume the same using Postman. However I am getting the following error,
 
Odata Action,
 
[SysODataActionAttribute('getCustomerList', false),
    SysODataCollectionAttribute('return', Types::Record, 'SalesLine')]
public static List getCustomerList(ItemId _itemId)
{
    List returnList = new List(Types::Record);
    SalesLine salesline;
 
    while select CustAccount, sum(SalesQty) from salesLine
        group by CustAccount
        where salesLine.ItemId == _itemId
    {
        returnList.addEnd(salesLine);
    }

    return returnList;
}
 
PS: I tried to send itemId in the body for the parameters that didnt work as well. It is missing in the screenshot.
 
I also tried https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/$metadata to check if my action is available and I couldn't able to see.
 
Thanks in advance :)
  • Layan Jwei Profile Picture
    Layan Jwei 7,264 Super User 2024 Season 2 on at
    OData actions is throwing No HTTP resource was found that matches the request URI error
    Hi Wekey,
     
    Can you take screenshots of your custom entity properties?
  • Wekey Profile Picture
    Wekey 300 on at
    OData actions is throwing No HTTP resource was found that matches the request URI error
    Hi Layan,
     
    Yes I am using the same URL you have mentioned. I am using the public collection name and not the data entity name. 
     
    As mentioned before I tried sending the JSON body as well with post request which is not added in the screenshot. Still the same issue.
     
    I have created a custom entity with custom table.
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,264 Super User 2024 Season 2 on at
    OData actions is throwing No HTTP resource was found that matches the request URI error
    Hi,

    The url should be like this:

    https://yourD365Url/data/yourDataEntity/Microsoft.Dynamics.DataEntities.getCustomerList

    What is the data entity you are using? did you use the public collection name for the entity in the url? I mean for example, if your entity is CustCustomerV3Entity, then you should use CustomersV3 in the url

    And you didn't fill the json body in your postman,  you should put sth like this:
    {
       "_itemId": "123" 
    }

    Also change GET to POST

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans