Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

create sales order by x++

(0) ShareShare
ReportReport
Posted on by 2,016

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
    Gunjan Bhattachayya 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
    mohammed.mqi 2,016 on at
    RE: create sales order by x++

    is this code will be after

    salesTable.insert();

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,331 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,333 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans