Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Not getting workflow o...
Finance forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Not getting workflow option

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans