Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Not getting workflow o...
Finance forum

Not getting workflow option

Posted on by 43
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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans