Hi,
I had followed this link for implementing the custom workflow
I could submit my record to workflow but the submit button stayed in the workflow dropdown. The Cancel and View History buttons did not appear. I could also submit a record as many times as I wanted to, but the buttons did not switch.
At last, I found that the issue was the canSubmitToWorkflow method. It was returning true after it had been submitted and thus did not allow the buttons to switch.
[ExtensionOf(formStr(BankReconciliation))]
final class BankReconciliation_Extension
{
/// <returns>boolean</returns>
public boolean canSubmitToWorkflow()
{
boolean canSubmitWorkflow = next canSubmitToWorkflow();
if (BankAccountTrans.WorkflowState != BankAccountWorkflowState::Approved)
{
canSubmitWorkflow = true;
}
else
{
canSubmitWorkflow = false;
}
return canSubmitWorkflow;
}
}
and also I tried to change the code as below
[ExtensionOf(formStr(BankReconciliation))]
final class BankReconciliation_Extension
{
/// <returns>boolean</returns>
public boolean canSubmitToWorkflow()
{
boolean canSubmitWorkflow = next canSubmitToWorkflow();
if (BankAccountTrans.WorkflowState != BankAccountWorkflowState::Submitted)
{
canSubmitWorkflow = true;
}
else
{
canSubmitWorkflow = false;
}
return canSubmitWorkflow;
}
}
while using above code the workflow option itself not visible.
Thanks & regards,
Lasya