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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Workflow validation on submit button

(1) ShareShare
ReportReport
Posted on by 135
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
  • GirishS Profile Picture
    27,845 Moderator on at
    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
    135 on at
    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,845 Moderator on at
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 539 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 431 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 184

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans