Skip to main content
Dynamics 365 Community / Forums / Finance forum / Button Confirm using s...
Finance forum
Suggested answer

Button Confirm using sys framework

editSubscribe (1) ShareShare
ReportReport
Posted on by 6
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
Attachments
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,446 Super User on at
    Button Confirm using sys framework
    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.
  • Waed Ayyad Profile Picture
    Waed Ayyad 2,076 on at
    Button Confirm using sys framework
    Hi,

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


    Thanks
    Waed Ayyad
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 2,076 on at
    Button Confirm using sys framework
    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
     
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 2,863 Super User on at
    Button Confirm using sys framework
    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
  • Button Confirm using sys framework
    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
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 3,905 User Group Leader on at
    Button Confirm using sys framework
    Hi,
     
    I would like to know what you need ?
    what is your issue ?
     
    Best regards,
    Mohamed Amine MAHMOUDI

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,183 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,733 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans