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 :
Microsoft Dynamics AX (Archived)

Workflow in Ax 2012 R3 - Reject to Draft

(0) ShareShare
ReportReport
Posted on by 2,172

Hello All,

I am totally new to workflow, I have created one sample workflow based on workflow document, with Approved, Rejected, Submitted and Draft status. In workflow creation form, i used manual decision as given in the document followed.

Now its working fine for Approve and Cancel but not for Reject. when i reject the workflow, it should go back to Draft status to allow customer to Resubmit. But now when i Reject, its changing the status as Approved. I have manually created Reject method, in event handler class and its not triggered when i check it with debugger.

And i have created only the workflow category and workflow Type  not the Approvals(I think it is only causing problem) as the given in the document i followed. Could anyone clarify the workflow steps(especially the Approvals) or any document to achieve what i wanted to create?

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,047 User Group Leader on at
    RE: Workflow in Ax 2012 R3 - Reject to Draft

    what your workflow should do at time of clicking reject can be controlled by code. can you show us code behind Reject Event.

  • Anand AX Profile Picture
    2,172 on at
    RE: Workflow in Ax 2012 R3 - Reject to Draft

    Thanks for the reply, The below is the code i used for reject, and this method is  created manually by me on the event handler class.

    public void Rejected(WorkflowEventArgs _workflowEventArgs)

    {

    MRKPContractRequestPoolTable    MRKPContractRequestPoolTable;

    select forupdate MRKPContractRequestPoolTable where MRKPContractRequestPoolTable.RecId== _workflowEventArgs.parmWorkflowContext().parmRecId();

    if(MRKPContractRequestPoolTable.RecId)

    {

    MRKPContractRequestPoolTable.ApprovalCRPStatus= ApprovalCRPStatus::Draft;

    MRKPContractRequestPoolTable.write();

    }

    }

  • Sohaib Cheema Profile Picture
    49,047 User Group Leader on at
    RE: Workflow in Ax 2012 R3 - Reject to Draft

    kindly proceed to following  path

    \Workflow\Approvals\..your custom Approval

    Expand your custom approval. right click REJECT and click on properties.

    Note down Type. what is type for your Reject  Outcome?

  • Anand AX Profile Picture
    2,172 on at
    RE: Workflow in Ax 2012 R3 - Reject to Draft

    Hi Sohaib Cheema,

    I proceeded as you said, "Return" is the type my Reject outcome.

    For your kind information, i didn't created Approvals when is created sample workflow based on the document, Later on only(After all steps) i have created Approvals for the same workflow.

    Now my problem is i don't have much idea about Approvals and and how to use it.

  • Verified answer
    Sohaib Cheema Profile Picture
    49,047 User Group Leader on at
    RE: Workflow in Ax 2012 R3 - Reject to Draft

    write above shown code in returned method of event handler class and retry after building Incremental CIL.

  • Anand AX Profile Picture
    2,172 on at
    RE: Workflow in Ax 2012 R3 - Reject to Draft

    Thanks Sohaib, Will try and let you know.

  • Anton Tjiptadi Profile Picture
    2,013 on at
    RE: Workflow in Ax 2012 R3 - Reject to Draft

    Hi Anand,

    Do you find solution for this ? I'm also facing the same problem, during Reject my code to update source table approval status is not working.

    PLease help.

    Thanks.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans