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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Validation on Custom workflow

(0) ShareShare
ReportReport
Posted on by 632

Hi Friends, I created new custom workflow. My requirement is that before approve the workflow i want to do validation on approve button please tell me where will write the code.

Thanks you.

Rahul.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Hi Rahul.

    Remember that as a general principle Approvals do not /should not allow editing or modifying, also logic in your configurations/security should ensure that by the time an approval lands in somebody's list there should not be validation necessary. There are many other good reasons to avoid validation on this level.

    Tasks however are slightly different in that users are generally allowed to edit records when assigned a workflow task.

    That said, from a coding point of view they are both very similar in the background. You need to define a menu-item on your task/approval workflow node linked to a complete (or approve) outcome (you would already have done this). This menu-item that you created is linked to a class. In this class you can build in whatever validation you need and only execute the actual workflow code if the validation is met. A great example is class "PurchReqWorkItemActionManager"

    Take a look at the main method for the general flow that you need. the logic in the "Validate" method is entirely up to you

  • Rahul.p Profile Picture
    632 on at

    Thank for your support Jonathan, I will work on that and get back to you .

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans