web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Button Confirm using sys framework

(0) ShareShare
ReportReport
Posted on by 65
Button Confirm:
Develop sys operation framework class to update status of selected
record to Confirmed.
 System should validate while changing the status to confirm, selected
sales order must have at least 1 line.
 This button should be enabled only for the records where status is draft.
Confirmed records should not be allowed to delete or edit
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at
    Hi,
     
    I would like to know what you need ?
    what is your issue ?
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Tejeswar Prasad Profile Picture
    65 on at
    I have to Implement confirm button in form, when select two draft(enum value from Status field) records , after i click on confirm button the selected record draft values convert into confirm value and the confirm value records cannot be editable ,this process using sys framework only!
  • Suggested answer
    Layan Jwei Profile Picture
    8,112 Super User 2025 Season 2 on at
    Hi Community member,
     
    What code did u try so that we can help you? It's better to explain ur issue.
     
    In general, you need to read about sys operation framework where you'll create a controller class and service class (maybe also contract class if needed)
     
    In the controller class you can pass multiple selected records
     
    In the service class you can confirm the sales order.
     
    I think there is no need to validate if the sales order has 1 line, because confirmation shouldn't work if there is no lines (u can test it once you implement the code) but if needed u there is validate method in the controller.
     
    Also, on the clicked button you can add validation to make sure selected records are with draft status
     
     
    Thanks,
    Layan Jweihan
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,
     
    Can you share your code? You don't want to use the standard Confirm Button of the form?  But your requirement can be implemented using Sys operation framework. Check the below blog about sys operation framework!
     
    Also, in order to make the button only enabled if the record status is Draft: 
     
    you can write the following code on the init and  active method of the form data source :
     
    let us assume your menu item name is  (ConfirmBtn):
     
    ConfirmBtn.enabled(SalesTable.StatusField==StatusEnum::Draft);
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,

    Is your issue resolved? If yes, mark the answers that helped you as verified.


    Thanks
    Waed Ayyad
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Use this link to confirm sales order. 
     
     
    You need to loop through selected records in UI on click on the button and then call the above method which will confirm the selected SOs. 

    For this button to enable on draft you can make use of active method.
     
    For disabling delete of confirmed orders, make some parameter in setup and if it's enabled then in active method get the form data source and call allowdelete(false) and allowedit(false) for that datasource.

    This can be done in sync mode and async mode. For async mode, you can write a batch job and send all selected records from UI to batch args method and there in run method you can do further process like said above.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans