Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

create sales order by x++

(0) ShareShare
ReportReport
Posted on by 2,030

greeting everyone 

i want create button to let user crate sales order automatic and skip this screen 

pastedimage1601296083722v1.png

i'll pass above info by code how can i do that?

and then i want show me this form for sales order

pastedimage1601296234658v2.png

 i see many codes but all inserted line of sales order

but i need from user to insert the line of sales order

here my code working fine but not show me form of sales order

NumberSeq NumberSeq;

;

NumberSeq =NumberSeq::newGetNum(SalesParameters::numRefSalesId());

salesTable.SalesId = NumberSeq.num();

salesTable.initValue();

salesTable.CustAccount = "SCR0001";

salesTable.initFromCustTable();

salesTable.insert();

how can i display forms after created the sales order 

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: create sales order by x++

    Hi mohammed,

    Yes. You will need to call SalesTable with a RecId  so that the same record is opened in the table.

    You might need to implement your code within a ttsBegin ttsCommit block as well so that the data is saved into the table.

  • mohammed.mqi Profile Picture
    2,030 on at
    RE: create sales order by x++

    is this code will be after

    salesTable.insert();

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: create sales order by x++

    Hi mohammed,

    You can try something like this to display sales order form

    rgs args;
            
    args = new Args();
    args.record(salesTable);
    new MenuFunction(menuItemDisplayStr(SalesTable), MenuItemType::Display).run(args);

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,245 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,927 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans