Skip to main content
Nintex Community Menu Bar

Validation Rule and button click function not working in Nintex form

  • May 27, 2021
  • 2 replies
  • 339 views

Forum|alt.badge.img+5

Dear All,

I have created a validation rule as below, Status is a dropdown.

1. Status == "Waiting for Approval" && isNullOrEmpty({Self})

2. and(calcStatus=="Waiting for Sponsor Approval",isNullOrEmpty({Self}))

calcStatus is storing dynamic value of dropdown value (Status)

Both are not executing 

17976i1A78B3936D7B888A.png

Also i have custom button click event as below, here i get two times alert and submitting an item.

NWF$('.nf-sponApprove').click(function(){
var scomm = NWF$('#'+varsponDisc).val();
if(scomm == ""){
alert("Please input sponsor comments");
}
if(scomm) {
NWF$('#'+varStatus).val("Sponsor Approved");
NWF$(document).submit();
}
});

 

Any help would be highly appreciated. Thank you advance.

Regards

2 replies

  • May 28, 2021

Hi,

Your first condition should work ok provided the Status being checked is correct( 'Waiting for Approval'. should it be 'Waiting for Sponsor Approval' ? ).

 

The rules can be a little tricky. If a rule isn't working; you can try some troubleshooting steps:

1) If some references were copied into the formula; try to re add them by selecting again from the builder

2) Add some Parenthesis. Simple; but can work and also improve readability in long conditions.

3) If the formula has been manually built and checked for typos; see whether there is room for refactoring. Eg: Like you have used  && operator instead of the fn.

4) Check the Browser's Console to see if an error is preventing the correct execution of Form.

 

Note
-------

The 'Named Control' can be used to get the dynamic value set from Form.

'Item Properties' will read the values saved in SharePoint when the form Loads.

 

Regards


Forum|alt.badge.img+5

tried to reconstruct the same rule but still not working.