Sometimes we need to enable disable button in Sales order form then you can apply your code in below method in SalesTableType class
\Classes\SalesTableType\canConfirmationBeUpdated
\Classes\SalesTableType\canInvoiceBeUpdated
\Classes\SalesTableType\canPackingslipBeUpdated
\Classes\SalesTableType\canPickingListBeUpdated
For sales order list page you can refer below method.
\Classes\SalesTableListPageInteraction\setButtonEnabled
\Classes\SalesTableType\canConfirmationBeUpdated
\Classes\SalesTableType\canInvoiceBeUpdated
\Classes\SalesTableType\canPackingslipBeUpdated
\Classes\SalesTableType\canPickingListBeUpdated
For sales order list page you can refer below method.
\Classes\SalesTableListPageInteraction\setButtonEnabled