Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Not allow submit to workflow based on a condition

Posted on by 150

In trvexpenses form there is a standard workflow.

If the amount in the trvexptrans table is more than 1000( just an example) I don't want the the user to be able to submit the record to the workflow.

How do I do this?

Do I extend the workflow event handler? If so then how?

Thank you 

  • PrachiGupta97 Profile Picture
    PrachiGupta97 150 on at
    RE: Not allow submit to workflow based on a condition

    Thank you so much this worked.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Not allow submit to workflow based on a condition

    Hi Prachi,

    Please check this link on how you can create CoC for a table method. I think validateSubmit method will work as well. To be sure, you can debug and make sure this method is being called before submitting to workflow.

  • PrachiGupta97 Profile Picture
    PrachiGupta97 150 on at
    RE: Not allow submit to workflow based on a condition

    How do I write a coc?

    I have not done one before..

    Also can I write it in the validatesubmit method of the table?

  • Suggested answer
    Alfasith AX Profile Picture
    Alfasith AX 120 User Group Leader on at
    RE: Not allow submit to workflow based on a condition

    Hi Prachi,

    Why dont you try flow controls ->  conditional decision in respective workflow design, select the table, coloumn and amount with < XXX.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: Not allow submit to workflow based on a condition

    Hi Prachi,

    Please check the method TrvExpTable\canBeSubmitted. This method already contains logic validating if an expense report can be submitted. You can create a CoC for this method and add your validation logic here.                                                

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans