Question 1: How to write nested if (If filed1 equal to "Ready for WOC" and field3 equal to Provider SSCR", then Field2 should be mandatory)
def field1 = getFieldByName("Current Status")
def field2 = getFieldByName("SSCR #")
def field3 = getFieldByName("Type")
if(field1.getValue().equals("Ready for WOC") ) // tried "AND", "&&", "&" but didn't work
if(field3.getValue().equals("Provider SSCR"))
{ field2.setRequired(true) }
else { field2.setRequired(false) }
Question 2: How to check if the value is greater than a specific value (If filed1 equal to "Ready for WOC" and field3 greater than 44.52, then Field2 should be mandatory)
def field1 = getFieldByName("Current Status")
def field2 = getFieldByName("Justification for High Blended Rate")
def field3 = getFieldByName("Actual Blended Rate")
if(field1.getValue().equals("Ready for WOC") )
if(field3.getValue().equals("44.52")) // not able to understand how to say greater than
{ field2.setRequired(true) }
else { field2.setRequired(false) }
Question 3:
How to say "not equal to". I tried "!=" didn't work.
I am trying to say field1 not equal to empty. and field1 is string.
Thanks in advance for your help!
Hi Anna,
For Q1: Try this
def field1 = getFieldByName("Current Status")
def field2 = getFieldByName("SSCR #")
def field3 = getFieldByName("Type")
if((field1.getValue().equals("Ready for WOC"))&&(field3.getValue().equals("Provider SSCR"))){}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.