Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / OData actions is throw...
Finance forum
Suggested answer

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

Posted on by 296
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 6,876 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 296 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 6,876 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans