Skip to main content

Hi

 

I'm struggling to find solution to having required fields completed by the assigned user before a workflow task can be complete.

Using a leave request as an example, if a request is approved no comments are required. If a request is rejected a comments field must be completed, if they are not the task cannot be actioned.

 

The only solution I have found to date is to loop back to the same step and use line rules to determine the route. Although this works the user has no indication that a required field is missing until the notification is sent again. I can call a rule that displays a message box stating that the submisison is being checked for required fields and an email will be sent if any are missing, but it's all a bit messy...

 

Thanks in advance

 

Dear ,

 

Could u provide more clarification about ur question , wt do u want to apply into ur solution ?

i got that u have issue in validations ... but i cant seem to know what is ur question is about exactly .

do  u need to find an indicator for smartform validation that pops up for users ? and for what controls ?

 

let me share couple of thoughts that might help u understand validations more .

there is a rule "when form passes validation" , this rule will give users indicators for required controls , but it works only for controls that has "pattern" .

so it wont be working for controls that dont have pattern .

and usually when i have to validate any control that doesnt have a pattern like date control , i customize the validation and show pop up warning for user about missing required fields .

simply by having data field with convinient name like "form validation" and give it value of 0 ,

and on submit button , i go check for all controls , advanced condition --> if controls are not empty with && between each condition , so if all condiitions equals to true , i go change the value of the form validation data label into 1 .

and underneeth that rule , i add advanced condition to check if form validation equals to 1 , then submit the form , if it doesnt equal to 1 , then i show pop up message for the required missing fields .

 

might be long but i hope it helps!

Regards.


Hi,

 

i dont see the requirement of workflow loop back in this case if i understoood the requirement clear.

 

This can be achieved by putting a validation on the when button submit rule.

 

in the worklist item action rule,  try this

 

place a condition that if a control on the worklist item action view contains a specific value "Approved"

and the form passes the validation.. configure the validation to the comments required

 

then action the worklist item.

 

 

 

hope this helps.

 

Thanks

Vijay


Thanks for the responses...

I'm using K2 Studio for the workflow and the initial form validation is not a problem, I am tryign to validate as the workflow progresses.

 

Vijay - Sounds promising, but where is where is the "Worklist Item Submit Rule? Does it run before submission?

 

I've attached an image which hopefully explains things better...

 

On the Approve Leave client event if Accpeted is selected comments are not required, if Rejected is selected then a reason must be added to the smartform which is shown beneath the Workflow Task.

Using line rules I check that if Rejected a reason has been added, if not then loop back.

What I need to do is pop up a vlaidation mesage and not action the task until the required field is completed and submit is clicked again.

 

Thanks

Dave

 


14641i56E6E208B5297C3F.png

Hi Dave,

 

Help Me understand if you are saving the comments in the smart object, or using the workflow comments?

also can you please tell me why do u want to to have the comments passed to workflow? if it is to understand and route, the process then its not required. the line rule condition is not required. the below approach will meet the requirements.

 

if you have a task form for the leave application, which goes to the manager, then the manager will have two actions either approve or reject.

 

the rule i explained was to be written here. as follows:

 

If you have a form control "Button" to perfrom the task.

 

case1: if you are saving the comments saved to smart object and have aview, then

 

in the task form on button submit, if a control on a view "Select Control which is the comments one" has a value and the form passes the validation

then action the task - pass the SN and action name

 

case2: if you are using workflow comments, then use above rule and select the workflow comments view. comments text are control.

 

 

 

if you are having a custom worklist item view and  have a dropdownlist of actions to action the task then you can write the same rule as

on worklist item view when submit is clicked

if a ddl action (Control) has a specific value - Approve

and if the form passes the validation - configure validations for comments text box or text area

then action the worklist item.

 

attached the rule snap shot for case 1 and 2

 

hope this clarifies.

 

 


16520iA6BAD0A23D585D5F.png

Hi Vijay

 

Thanks, now got it working as required.

The problem was that I was trying to use a workflow view and not a specific view for the approver.

Switching the Action Display Settings to "Configure how ... using K2 Designer" (as on the attached), adding submit button and rules was the answer.

 

Now to revisit the forms I have already developed and update them :(

 

rgds

Dave


10902i1F2CC266B1297726.png

Thats more like it , 

always use the "configure them manually in k2 smartform"

to have full control of submitting a form and its validation , 

 

good luck =)

Regards.


Reply