cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Problem with Validation rule

Jump to solution

I am attempting to set a validation rule against a control to prevent it from being blank unless another control equals "Instructor Substitute".  Here is what i have in the rule.

PaySchedule==""&&PositionTitle!="Instructor Substitute"

Now the control name i have the rule on is PaySchedule.  If I remove the section of PositionTitle, the rule functions correctly.  I've checked my spelling just to make sure somewhere I've made a stupid typo.  I've also tried removing the check against the control being blank and have it check on PositionTitle.  That check never seems to work.  For some reason, it cannot see what is actually in that control.  Not sure if it matters or not, but PositionTitle is a Sql Request Control.  Is there something here I'm missing?  

0 Kudos
Reply
7 Replies
Workflow Hero

Re: Problem with Validation rule

Jump to solution

- do not compare against empty string, use rathre IsNullOrEmpty() inline function: IsNullOrEmpty(PaySchedule) 

- I'd say SQL request control works similarly to lookups - it returns ID & value together, so you will have to use parseLookup() runtime function to get one or the other part out of it.

try to add calculated value control on the form and set its formula to PositionTitle to make sure how does it exactly evaluate.

Reply
Workflow Hero

Re: Problem with Validation rule

Jump to solution

Sorry it took so long for me to get back to you. Ok, that worked. Basically I had to create a calculated value field and do a parselookup on the Position title control. Now, I have another issue. So basically after the offer is approved by management, the position is offered. I have another place to insert the pay schedule. This allows the potential employee to negotiate for pay. I need to see if FinalStepSchedule is blank unless the offer was rejected or the position title is Instructor Substitute. See formulas:

=="1"&&isNullOrEmpty(FinalStepSchedule)&&(PositionStatus<javascript:void(0);>!="Rejected"||PositionCheck<javascript:void(0);>!="Instructor Substitute").

I’ve tried this a couple different ways. I tried

(=="1"&&isNullOrEmpty(FinalStepSchedule)&&(PositionStatus<javascript:void(0);>!="Rejected)||( =="1"&&isNullOrEmpty(FinalStepSchedule)&& PositionCheck<javascript:void(0);>!="Instructor Substitute").

But that didn’t work. I’m guessing my crafting of and/or statements is most likely my problem.

Nintex Community <https://community.nintex.com/?et=watches.email.thread>

Re: Problem with Validation rule

reply from Marian Hatala<https://community.nintex.com/people/emha?et=watches.email.thread> in Getting Started - View the full discussion<https://community.nintex.com/message/84965-re-problem-with-validation-rule?commentID=84965&et=watches.email.thread#comment-84965>

0 Kudos
Reply
Workflow Hero

Re: Problem with Validation rule

Jump to solution

your formulas aren't syntactically correct, == comparison operator needs two arguments, ie. formula should look like A==B && C != D

not sure what you wanted to achieve with ">!=" but this is not valid operator at all

0 Kudos
Reply
Workflow Hero

Re: Problem with Validation rule

Jump to solution

Sorry the ">" symbols were added when I responded via email.  Here is formula I have in currently. {ItemProperty:HR016_IsApproved}=="1"&&isNullOrEmpty(FinalStepSchedule)&&(PositionStatus!="Rejected"||PositionCheck!="Instructor Substitute")

0 Kudos
Reply
Workflow Hero

Re: Problem with Validation rule

Jump to solution

and?

syntactically it seems correct now...

0 Kudos
Reply
Workflow Hero

Re: Problem with Validation rule

Jump to solution

Sorry for the late response on this one.  After working on this to get it to work (above formulas worked), HR decided they did not want this functionality.  So all for naught .  Thank you Marian for your assistance.

0 Kudos
Reply
Workflow Hero

Re: Problem with Validation rule

Jump to solution

don't mind

if above suggestion worked, consider selecting and marking a post as a correct answer. it may at least help others.

0 Kudos
Reply