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 :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

OData action using Postman

(0) ShareShare
ReportReport
Posted on by 108

Hello,

I am using Postman to try and insert Header and Lines in data entities in D365.

Is it even possible to set a class as a parameter in the action method that I am calling? If not, what would be the right approach for this?

I try to use a contract class and initialize the header and lines there but I get the following error when I Send the Post action via Postman: 

"No HTTP resource was found that matches the request URI '<myurl>/data//"My custom entity header"/Microsoft.Dynamics.DataEntities."action method"'. No route data was found for this request."
[SysODataActionAttribute('actionMethod', false)]
public static void actionMethod(ContractClass _contractClass)
{
ContractClass contractClass= _contractClass;
ClassCreate classCreate = new ClassCreate ();
classCreate.createHeaderLines(contractClass);
}

Thanks in advance. 

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Zoran,

    I don't know what you want to achieve with the ContractClass. Can you explain the business requirement? If the ContractClass is a class in Dynamics 365, then I do assume it is not possible what you are trying here. If it is a string variable, you can use it to receive values from an external tool like Postman.

  • Zoran Golomeov Profile Picture
    108 on at

    Hi Andre,

    I need to insert into header and line entities before inserting into respected tables.

    Need to Passa list of objects as Input to an Odata Entity Method

    This should be done with one call for multiple lines.

    I was thinking if I can use a custom created contract class in D365 where I can initialize the header and lines passed through Postman action.

    Here is an example of the action I want to post:

    {

       "ContractClassPassedAsParameter":

        {

           "Header": {

          Header info

           },

           "Lines": [

               {

               Line 1 info

               },

               {

               Line 2 info

               }

           ]

       }

    }

    A similar requirement can be found in the following thread were I was advised to use web service

    community.dynamics.com/.../1055672

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Zoran,

    As far as I know, contracts are not supported (only primitive types, arrays (list etc) and public updatable view according to the documentation).

    If you want to use contract use web service or you can pass json as string to oData action and use FormJsonSerializer class to deserialize it to contract.

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 > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans