Skip to main content

Notifications

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

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

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 73,472 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans