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, ...
Suggested Answer

Workflow validation on submit button

(1) ShareShare
ReportReport
Posted on by 131
I am trying to add validation before Timesheet workflow submit: 
 
All timesheet-> click on workflow ->submit ->will check if validation pass->workflow submitted successfully.
 
For that I have done:
1. write logic in a class:
class abcTSTimesheetapprovalvalidationworkflow extends WorkflowWorkItemActionManager
{
logic to validate;
}
2. create action menu item and add above class 
what should be the next step in it so that I can use the validation?
 
OR is there any other way for this validation before workflow submit for timesheet?
 
Thankyou.
Ayusri
I have the same question (0)
  • GirishS Profile Picture
    27,827 Moderator on at
    Workflow validation on submit button
    Hi Ayushri,
     
    I would suggest you to add validation on canSubmitToWorkflow method at table level.
    This method will decide whether to show the workflow submit button based on some condition.
     
    Thanks,
    Girish S.
  • aayushii Profile Picture
    131 on at
    Workflow validation on submit button
    Hi Girish,
     
    Thankyou for the quick reply!
    When I tried: cansubmittoworkflow COC method on table: TSTimesheetTable
    it will give this error (validation) everytime I tried  to open this timesheet entry whenever i tried to do other operation like save, it throws this error.
    But, I want this validation only when I click on workflow button not before this step.
     
    thankyou
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at
    Workflow validation on submit button
    There is a method named validateSubmit on TSTimesheetTable - Just write COC for that method and check whether its suits your scenario.
    Also, there is a method named validate on the TsWorkflowActionManager class which will be called whenever you submit the header workflow. Add COC for that method and add validation there. 
     
    Thanks,
    Girish S.

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