Skip to main content

Notifications

Announcements

No record found.

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

Ax 2009 purchase order posting migration to D365

Posted on by 5

Hello all, i have this process defined in 2009  where we invoice selected PO lines which matches with custom table. i have to migrate this to D365 but the framework is completely changed. i am freaquently getting errorrs at different place. can anyone please share any code snipet which can help in this scenario. 

#private parmId postInvoice()
#{
# //post invoice for all matched purchase lines
# PurchFormLetter_Invoice purchFormLetter;
# QueryBuildDatasource invoiceDS;
# UserId userId = curUserId();
# ;
# purchFormLetter = PurchFormLetter::construct(DocumentStatus::Invoice, true);
# purchFormLetter.reSelect(PurchUpdate::All, NoYes::Yes);
# purchFormLetter.transDate(transDate);
# purchFormLetter.interCompanyInitQueryBuild();
#
# switch (importType)
# {
# case ABC_ImportType::POInvoiceAccrual :
# invoiceDS = purchFormLetter.queryChooseLines().query().dataSourceTable(tablenum(PurchLine)).addDataSource(tablenum(ABC_POInvoiceAccrual));
# invoiceDS.addLink(fieldnum(PurchLine, ABC_LoadNumber), fieldnum(ABC_POInvoiceAccrual, LoadNumber));
# invoiceDS.addLink(fieldnum(PurchLine, ItemId), fieldnum(ABC_POInvoiceAccrual, ItemId));
# invoiceDS.joinMode(JoinMode::ExistsJoin);
# invoiceDS.addRange(fieldnum(ABC_POInvoiceAccrual, CreatedBy)).value(userId);
# invoiceDS.addRange(fieldnum(ABC_POInvoiceAccrual, HasErrors)).value(SysQuery::value(NoYes::No));
# invoiceDS.addRange(fieldnum(ABC_POInvoiceAccrual, RefInventTransId)).value(SysQuery::valueEmptyString());
# invoiceDS.addSortField(fieldnum(ABC_POInvoiceAccrual, createdDateTime), SortOrder::Descending);
# break;
#
# default : return purchFormLetter.parmId();
# }
#
# purchFormLetter.parmParmTableNum(this.parmInvoiceId());
# purchFormLetter.createParmUpdate (false);
# purchFormLetter.sumBy(AccountOrder::Account);
# purchFormLetter.chooseLines (false);
# purchFormLetter.run();
#
# return purchFormLetter.parmId();
#}

  • MuthukumaranAX Profile Picture
    MuthukumaranAX 2,907 on at
    RE: Ax 2009 purchase order posting migration to D365

    can you share the error details?

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans