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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

trigger while sales Lines being created

(0) ShareShare
ReportReport
Posted on by

Hi experts,

I need to fire some code when user create SalesLine for a salesOrder.

So where should I write the code , what would be the correct place to put my code.

Thanks. 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: trigger while sales Lines being created

    It depends on the code which you intend to run. If it is supposed to execute whenever a SalesLine record is inserted even when it is from other sources such as AIF or a custmer portal sales basket, then you'd have to override the insert() method on SalesLine table. Write your own logic in a new method that you create, and call that method from insert(). A better option would be to use a post-eventhandler subscription for the insert method, so it would be easier to upgrade for future versions. Also please note that in Standard AX they added a class maintaining operations with the sales objects and you might place your logic in there as well, take a look at the SalesLineType class.

    If you only want to fire your logic on the SalesTable form only when raising the order through the AX user interface, then you'd override the SalesLine formdatasource's write() method.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans