web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

workflow submit button not display

(0) ShareShare
ReportReport
Posted on by 2,050

i'v created custom workflow for Sales Credit Limit in SalesTable form

but after that when any user create new sales order it's created directly even there's no submit button of my workflow

here my project which i created i'm using ax2012R3

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at
    RE: workflow submit button not display

    Hi!

    Did you setup the workflow ?

  • mohammed.mqi Profile Picture
    2,050 on at
    RE: workflow submit button not display

    yes i did without error 

    here.png

    here2.png

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at
    RE: workflow submit button not display

    Is it also don't appear on the new SalesOrders which are were created after workflow activating?

  • mohammed.mqi Profile Picture
    2,050 on at
    RE: workflow submit button not display

    thanks for replay

    even on new SalesOrders which are were created after workflow activating not appear

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: workflow submit button not display

    Hello mohammed,

    Difficult to what what might be missing.

    Do you have access to a D365Fo demo environment where such a workflow is available in the standard solution. Maybe you can compare your own design with what is done in D365FO.

    Best regards,

    Ludwig

  • Verified answer
    Sumit Loya Profile Picture
    2,230 on at
    RE: workflow submit button not display

    Hi Mohammed,

    Code in method Table > SalesTable > Method > canSubmitToWorkflow seems to be an issue.

    public boolean canSubmitToWorkflow(str _workflowType = '')
    {
        AmountMST creditBalance;
        CustTable   custTable;
        boolean ret;
    
        ret = super(_workflowType);
    
        if(this.SalesCreditLimitWorkFlowStatuse==SalesCreditLimitWorkFlowStatuse::NotSubmitted)
        {
            ret=false;
        }
    
        return ret;
    }

    The line 

    if(this.SalesCreditLimitWorkFlowStatuse==SalesCreditLimitWorkFlowStatuse::NotSubmitted)
        {
            ret=false;
        }

    This is not correct. By default the Status will be Not submitted and if it is not submitted you are returning false. This will mean that workflow submit is  not applicable and hence Submit button is not visible.

    Try changing the code as shown below:

    public boolean canSubmitToWorkflow(str _workflowType = '')
    {
        AmountMST creditBalance;
        CustTable   custTable;
        boolean ret;
    
        ret = super(_workflowType);
    
        return this.RecId != 0;
    }

    .

  • mohammed.mqi Profile Picture
    2,050 on at
    RE: workflow submit button not display

    thanks for replay Sumit Loya

    it's now display and still keep display after press on

    pastedimage1570505580291v1.png

    but when i clickd on Submit button nothing happens after that message

    and i can't see other action like approve or reject 

  • Suggested answer
    Sumit Loya Profile Picture
    2,230 on at
    RE: workflow submit button not display

    Hi Mohammed,

    The next issue is in class SalesCreditLimitWFSubmitManager method main. Following section

    try
    {
        ttsBegin;
        workflowCorrelationId= Workflow::activateFromWorkflowType(workflowTypeName, recid, note, NoYes::No);
        salesTable.SalesCreditLimitWorkFlowStatuse=SalesCreditLimitWorkFlowStatuse::Submitted;
        info("Workflow Submitted");
        ttsCommit;
    }

    You have written the code to change status to submitted but have not called update method. Please add a line before info to call salesTable.update().

    You can check following link on Workflow Detailed Development. This was written for AX 2009 but basic development principles remain same for both AX 2009 and AX 2012.

    You can compare this link and your code  to  streamline the workflow code..

  • mohammed.mqi Profile Picture
    2,050 on at
    RE: workflow submit button not display

    thanks for replay

    i'v check link i try to import it but i got some error

    i did change as you say adding salesTable.update().

    but still there's problem button submit after press still not going

    i think the proble from canSubmitToWorkflow method

    public boolean canSubmitToWorkflow(str _workflowType = '')
    {
    AmountMST creditBalance;
    CustTable custTable;
    boolean ret;
    
    ret = super(_workflowType);
    
    return this.RecId != 0;
    }

    because still show me submit button

    but when i stop my workflow it's show me action button but like this

    6724.Capture2.png

    and when i press there i got this

    0447.Capture3.png

  • Suggested answer
    Sumit Loya Profile Picture
    2,230 on at
    RE: workflow submit button not display

    Hi Mohammed,

    I suggest you check my link first. There are label issues and looks like you have Cancel menu item applied for all outcome elements. Please check that once.

Under review

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

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans