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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Insert a new line in Sales Order lines using X

(0) ShareShare
ReportReport
Posted on by 345

Hi,

I have developed a form "MyForm", in that I have 'Item' , 'Item Name', 'qty' , 'cust account', 'sale order Id'  colums . I want to insert the lines in the sales order from "MyForm" , whenever I press update button on MyForm.

Help me plz.

 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Lauras U Profile Picture
    959 on at

    Hi. try this code:

    NumberSeq numberSeq;
    SalesTable salesTable;
    SalesLine salesLine;
    ;
    ttsbegin;
    numberSeq = NumberSeq::newGetNumFromCode(
    SalesParameters::numRefSalesId().numberSequence,true);
    salesTable.SalesId = numberSeq.num();
    salesTable.initValue();
    salesTable.CustAccount = '1101';//Your cust account from form
    salesTable.initFromCustTable();
    if (!salesTable.validateWrite())
    {
     throw Exception::Error;
    }
    salesTable.insert();
    salesLine.SalesId = salesTable.SalesId;
    salesLine.ItemId  = '1205';    //your item id from form
    salesLine.SalesQty = 0;     //your qty from form
    salesLine.createLine(true, true, true, true, true, true);
    ttscommit;

  • Suggested answer
    Ram Prasad Profile Picture
    345 on at

    thank you

  • Suggested answer
    Manikanda Gopal Profile Picture
    258 on at

    Hi Ram / vukis ,

    Is that worked .. Could you please take a look at "community.dynamics.com/.../177284".

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans