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 :
Microsoft Dynamics AX (Archived)

To write the custom code when Sales Orders is update update

(0) ShareShare
ReportReport
Posted on by 587

Hi All,

I am .Net developer and doesn't know much about AX. I need some help on AX Sales Order. In AX Sales Order there are Sales order header and Sales order lines.

My requirement is that whenever any sales order line is added/updated or deleted, i want to create the xml of all the lines and send that xml via ftp.

Where and how to write the code for this purpose.

If explain with some example code/tutorial it will be of great help.

 

 

 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    very few people would be interested into doing coding for others.

    well here goes the generic ides to achieve it optimally

    1) Create a new table with fields as under

    SalesId: 1001

    DateTime: 31-march-2015 12:34:26 PM

    ActionType: Insert/Delete/Update [BaseEnum]

    SOLineRefeRecId: //in your case can be RecId of SalesLine, which is being added, updated or deleted

    2) Now go to table SalesLines, on methods delete, Insert and update, write code, to create acorresponding record in your newly created table(step#1). In case of delete, write code before super();

    3) now create a runBase or sysOperation based class that can read records from your Custom Table and can send xml to anywhere.

    The [purpose of create a new table and doing it through batch process, is that if you think to write direct code in table methods, it may fail at any point, during sending of xml file or so on any reasons. also performance of ax will be effected if it has to excute code every time, you create/delete/update a record. so, operating it via BatchJob is much optimal

  • MSKAX Profile Picture
    120 on at

    Hi Samira,

    Sohaib made appropriate recommendations. This task felt interesting to me. I have done a quick development. This generates xml file.

    Anyone tell me how to attach xpo here...?? or a common place to upload...??

    Regards,

    OSMHN

  • SamiraM Profile Picture
    587 on at

    HI OSHM,

    Can you send me on my email. It will be of great help. 

  • MSKAX Profile Picture
    120 on at

    Hi Samira,

    Sorry, you have to share your mail id on forum.

    Anyway, I sent .xpo to your id.

    Good luck.

    Regards,

    OSMHN

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans