Hi,
I have created a custom workflow to Enable/Disable the Generate invoice button since there is no Out of the box Workflow for sales Order .
I can able to trigger the Workflow using canSubmitToWorkflow() (form Extension) and it is working fine .
[ExtensionOf(formstr(SalesTableListPage))]
public final class SalesTable_GD_SalesTableWF_Extension
{
public boolean canSubmitToWorkflow()
{
boolean canSubmitToWorkflow= next canSubmitToWorkflow();
if(SalesTable.WorkflowState == GD_SalesTableWFApprStatus::Draft)
{
canSubmitToWorkflow= true;
}
return canSubmitToWorkflow;
}
}
But when I try to add the code in order to enable/ Disable the Button , It triggers only the setButtonSalesOrder() code (Class Extension) but not the canSubmitToWorkflow() (Form Extension).which is for Workflow. May I know why it doesn't trigger both the classes ?
[ExtensionOf(classStr(SalesTableListPageInteraction))]
final class InvoiceButton_Extension
{
protected void setButtonSalesOrder()
{
SalesTable salesTable = this.currentSalesTable();
next setButtonSalesOrder();
if(salesTable.SalesStatus != SalesStatus::Invoiced && salesTable.WorkflowState == GD_SalesTableWFApprStatus::Approved)
{
this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage,buttonUpdateInvoice), true);
}
else //if(salesTable.SalesStatus == SalesStatus::Invoiced)
{
this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage,buttonUpdateInvoice), false);
}
}
}