Skip to main content
Nintex Community Menu Bar

Validation rules not working

  • August 1, 2017
  • 15 replies
  • 228 views

Forum|alt.badge.img+7

I am running the latest version o Nintex Forms on SharePoint 2013 Enterprise and can't get the validation rule on a form to work. It worked first time, but every attempt to test in the preview fails to use the validation. I am using IE11 for testing as that is the target browser for our users.

I have added a rule on a drop down control and told it to look at the values in two drop-down controls and see if they are equal.

the rule as I have written it is:

Control is invalid if:

Then show a message that says that the choice for Funding Type should be "A".

This worked once and the failed to function every time after.

I created another formatting rule to hide a panel based on a choice and that works fine.

Does anyone have any experience of what could prevent validation rules from working? This is driving me nuts as I am sure the rule is written correctly when it worked the first time. I have also tested it in Firefox with the same result.

Appreciate any help.

15 replies

Forum|alt.badge.img+14
  • Scholar
  • August 1, 2017

what are BusinessUnit and FundingType, named controls or item properties?


Forum|alt.badge.img+7
  • Author
  • August 2, 2017

They are drop-down named controls.I have applied the rule to drop-down control A but tested it on the 'Save' button and elsewhere and this simple operation just doesn't work.


Forum|alt.badge.img+14
  • Scholar
  • August 2, 2017

are they dropdowns for choice field or dropdowns for lookup field?


Forum|alt.badge.img+7
  • Author
  • August 2, 2017

They are choice drop-downs not lookups from other lists.


Forum|alt.badge.img+14
  • Scholar
  • August 2, 2017

ok.

so to debug what's going on with the formula I'd suggest following

- place 3 calculated value controls on form

- configure fromula for 1st one just to: BusinessUnit

- configure fromula for 2nd one just to: FundingType

- configure fromula for 3rd one to: BusinessUnit=="A"&&FundingType=="B" (configure it anew, do not copy&paste)

post a screenshot how do they evaluate


Forum|alt.badge.img+7
  • Author
  • August 2, 2017

II added those fields as per your instruction and then ran the form making the choices. The sum appears to result in "false". For context A is the BLC value and B is the Time and Material value. The third is the result of the sum.

The sum is:

BusinessUnit=="BLC"&&FundingType=="Time & Material"

206169_pastedImage_1.png

Thanks


Forum|alt.badge.img+14
  • Scholar
  • August 2, 2017

hm, don't you have some orphaned space in some string?

can you add calculation with following formulas

length(BusinessUnit)

length(FundingType)

and just just to be sure, two another calculations with formulas

FundingType=="Time & Material"

BusinessUnit=="BLC"


Forum|alt.badge.img+7
  • Author
  • August 2, 2017

Done. Here is the result (in order of your instructions). Very odd. Not sure what to make of this. i have checked every field on the rest of the form for any possible duplicates and not found any sad.png

206170_pastedImage_1.png


Forum|alt.badge.img+7
  • Author
  • August 2, 2017

I used a variation of the formula in the calculated column to check when the values DoNotEqual:

206183_pastedImage_1.png

The result is returned as True.

206184_pastedImage_2.png

I used the same formula in the rule and but it still does not fire and present the error message i configured:

206186_pastedImage_4.png

Not firing message when validating:

206185_pastedImage_3.png

It's starting to look like the product feature (validation rules) is broken?


Forum|alt.badge.img+14
  • Scholar
  • August 2, 2017

can you check developer console whether there are not reported any errors?

how many controls the rule is assigned to?

resp. can you proof check the rule is assigned to the control you think it is.

do you have applied other validation rules to the same control?

do you have applied any custom validation to the control apart from rule?

there is an exclamation mark on top right corner of your rule definition. can you hover over it what hint does it throw?

it shouldn't be a problem, but to rule it out, can you remove '&' sign from "Time & Material"

can you try with following formula rewrite

and(equals(BusinessUnit,"BLC"),equals(FundingType,"Time & Material"))

if it still doesn't give expected results, you may try to debug it as above


Forum|alt.badge.img+7
  • Author
  • August 2, 2017

Hi Marian

Your validation rule:

206189_pastedImage_3.png

Result:

206187_pastedImage_1.png

No rule message:

206188_pastedImage_2.png

Filled out all required fields and the form validates when it shouldn't.

* I am not skilled with the console but here is the only line highlighted in the "debugger" section:

206190_pastedImage_4.png

It says: "return itemDivObject;},ResizeCanvas:function(){var offset=0;if(NWF$("#s4-titlerow:visible").height()!=null){offset=NWF$("#s4-titlerow").outerHeight();}"

* I Updated choice column by Removing ampersand(&) and adjusting in formula:

206191_pastedImage_126.png

Still returns false:

206192_pastedImage_127.png

* The exclamation mark says: Some controls that are associated to this rule are linked. Any changes to this rule will affect the following linked controls: BusinessUnit(All layouts).

* The rule is assigned to the BusinessUnit drop-down control. D

Does it have to be assigned to the Funding Type control as well?)

* There are no other rules applied to BusinessUnit control . There is a formatting control applied to a pnel that checks the BusinessUnit value is not BLC and hides the panel until it is BLC. I tried removing this rule and the resultof the formula still returns false.

* I have only applied this validation rule so far and the formatting rule mentioned above. have not gotten any further than this first attempt at form validation.

* I have also tested the form out of Preview mode with the same results.

This feature shouldn't be this difficult right? 


Forum|alt.badge.img+14
  • Scholar
  • August 2, 2017

This feature shouldn't be this difficult right? 

yeah, that's right happy.png

feature is not problematic on its own, but if there's a problem on form/page it might be problematic to troubleshoot it.

* I am not skilled with the console but here is the only line highlighted in the "debugger" section:

if script execution stopped without a breakpoint set and with no apparent reason, that because of a error on page.

look for console tab in developer console, there are written all the errors.

this is how it looks like in IE11

206175_pastedImage_6.png

note you have to first open console and then run the form to see errors.


Forum|alt.badge.img+7
  • Author
  • August 3, 2017

Hi Marian

I found the problem by following the error in the Console. The problem was a  stray line of JavaScript in the settings section of the form. I had tried to create function with the same name I used for the control before I found the Validation functionality. I have removed it and it's working now.

Firstly, thank you for your guidance and patience. Secondly, sorry to have wasted your time with a problem I created. confused.png

All the best.

Harry


Forum|alt.badge.img+14
  • Scholar
  • August 3, 2017

not a problem, glad to help happy.png


Forum|alt.badge.img

Dear Harryr,

 

Can you show me how you've edited the error in javascript? I have the same errors in my form. The validation rules I've put in comparing dates are not working.

 

Hope you can help me...

 

Thanks.