Disabled buttons and fields on sales Confirmation

Hi ,
I am working as technical consultant , and I have only 6 month experience . But i have a work on Dynamics 365 FO where i have to create transfer order and disabled all button and fields of sales table form after sales order confirmation ,
So can any one please help me , should i take extension of Closeok method of SalesEditLines form or any other options is there because there exist a record in custconfirmjour form.

I’m assuming that you want the buttons and fields to be disabled when the order is in a particular state, even if you close the form, open it again and navigate to the record. If so, it’s obvious that there is no SalesEditLines involved in this case, therefore putting your logic there wouldn’t meet your requirements.

You need to evaluate the condition (and enable/disable controls) every time an order is selected in SalesTable form. It can be done by extending active() method of the form data source.

If you look at active() method of SalesTable data source in SalesTable form, you’ll notice that there already is logic to disable SalesTable and SalesLine data sources and it’s controlled by SalesTableForm.editHeaderAllowed(). And editHeaderAllowed() takes the value from salesTable.checkUpdate() method, which may be the right place for your condition.

But I would think the logic through before making any changes. For example, if you disable everything, how will you ever use the order? You wouldn’t be able to process it in any way (such as invoicing it) in the given form. Also, wouldn’t a workflow be the right solution for your requirement? (I don’t know, because you mentioned just implementation details, not the actual business requirement.)