Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Integrate and post purchase order

(0) ShareShare
ReportReport
Posted on by 715

HI,

Can somebody suggest me the best approach to integrate and post the Product receipt and invoice for Purchase order in D365.

Regards,

Pradeep

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: Integrate and post purchase order

    "Metadata" is a very generic term. Where exactly do you expect to see the actions and why do you think that they should be there?

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: Integrate and post purchase order

    I'm using the Proxy classes generated by OdataClientCodeGeneartor.

    I mean, I did find entities with actions for example ProjectsEntity. But the actions inside the entity are not seen in the metadata.

    Example: GetProjectTypes method is an action.

    My question is, why is that we are not able to see these actions as a part of metadata. But MS document as stated above says, these methods when exposed would be part of metadata.

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: Integrate and post purchase order

    What do you want to hear about the piece of documentation you've quoted. Is there something you don't understand?

    What do you mean by "I didn't find any in Standard entities". Do you mean that you didn't find entities with actions? Try finding references of the attribute.

    Note that you still didn't tell us which .NET API you're using to call OData services. We can't tell you how to call OData actions through your API until you tell us which API it is.

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: Integrate and post purchase order

    If you see the screen shot in the link, when methods are exposed they should be part of metadata. But I didn't find any in Standard entities.

    In this example, the SysODataActionAttribute class decorates the CalculateMaintenanceDuration method that is exposed as an action. The first argument of the attribute is the publicly exposed name of the action, and the second argument indicates whether this action is always available. Methods that are exposed as actions can return any primitive type or another public updatable view. After this method is exposed, it appears in the OData $metadata. Here is an example.

    docs.microsoft.com/.../1_odata.png

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: Integrate and post purchase order

    How you call OData actions from .NET depends on which API you use. Are you using proxy classes generated by the OData Client Code Generator or something else?

    The page doesn't contain any reference to "FunctionImport", therefore I don't know what you mean.

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: Integrate and post purchase order

    Hi Martin,

    I have created the Odata action, as suggested in the proposed link. Can you please guide me, how to trigger this Action from .net?

    Though we have many standard OdataActions. When I checked their metadata, I don't see any attribute "FunctionImport" as said in the document.

    Regards,

    Pradeep

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: Integrate and post purchase order

    You said you wanted to "to do a POC using OdataEntities", so that's what I was helping with. I suggested you should use OData actions, not data entity events. OData actions can contain any arbitrary logic (therefore they can do posting too). They're implemented as X++ methods; you can see a few examples in documentation.

    There are other possible approaches, but giving up OData just because of a feeling sounds wrong. I suggest you reject the discussion about feelings and turn it to a discussion about performance goals and measurements.

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: Integrate and post purchase order

    Hi Martin,

    Yes it’s one way communication.

    My customers are feeling using OData entities the performance is very slow.

    Do you suggest any other approach?

    If I’m using OData entities, which event do you suggest to write the posting logic?

  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    RE: Integrate and post purchase order

    Aha, so "to integrate" means a one-way communicate from another system to AX, which will allowing creating purchase orders and some kinds of posting. Is that correct?

    You can use OData actions to add logic (such as posting) to entities.

  • Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: Integrate and post purchase order

    Hi Andre,

    I want integrate the data from a third party system into AX. There shall be no condition for approval as such now.

    My customer feels Odata is bit slower and they need some better approach as the data would be larger in the future.

    Thus, I wanted a scalable approach for this scenario and I would like to do a POC using OdataEntities. Thus, If I import the data using Odata, how shall I post the Product receipt and confirmation?

    Regards,

    Pradeep

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans