Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Changing status to Received&Invoiced by Getting all lines of specific order from GetReceiptLines

(0) ShareShare
ReportReport
Posted on by 1
I have a field InvoiceStatus on the Purchase Order list. The available options for this button are Open, Received, and Received & Invoiced. The default status is Open. However, when I generate all lines from GetReceiptLines and post the purchase invoice, all the lines from GetReceiptLines are included and posted. I want the status of the InvoiceStatus on the Purchase Order List to change to Received & Invoiced. How can I achieve this using AL?
Note: If any one line is left on purchase invoice, status should not change to received & Invoiced if final line is posted it should change.

 
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,802 Super User 2024 Season 2 on at
    Changing status to Received&Invoiced by Getting all lines of specific order from GetReceiptLines
    As far as I know button(Action) does not have status, and the button does not support dynamically displaying different captions. If you need to do that, you need to create three buttons.
    If the button you mentioned is a field, this should be possible to modify the status in the code for GetReceiptLines and posting.
     
     
    Hope this can give you some hints.
    Thanks.
    ZHU
     

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans