Changes

Jump to: navigation, search

SmartCheck Validation

1,107 bytes added, 15:22, 9 December 2015
no edit summary
[[image:Smartcheck_validation_old_val_message2.png]]
Clicking on an in context message , such as the description field above, enables you to temporarily hide the message. Clicking the error message at the top will bring the cursor to the field where the error is present (if there is a corresponding input).
Before you can use SmartCheck validation you must first enable it. Note that once you turn on SmartCheck Validation it is enabled everywhere. If you already set up submit logic or other validation before you turned on SmartCheck validation, you will need to test your validation to ensure it works as expected and or replace it with SmartCheck validation.
</pre>
=Form Value vs Stored Value=In the SmartCheck code builder there is a select where you choose between '''Form Value''' and '''Stored Value'''. The '''Form Value'''' is the value someone has entered into his or her application (form), this includes information that has not been saved. The '''Stored Value''' is the value from the server (information that has been saved). By using the Form Value you can validate based on information that the user has entered into the form even if they have not clicked save on their application.
Here is how it looks when you call the Form Value for a standard field.
if(form.getStr("sf_Application Name") == "")
Here is how it looks when you call the Stored Value for the same standard field.
if("@Application Name@" == "")
Notice the stored value calls the field using the variable syntax we learned in the variable processor lesson.
=Examples=
====Check an amount is greater than $100,000====
<pre>if(ssParseNum(form.getStr("cf_Amount Requested")) > 100000) {result.isPassed=false; result.addMsg('cf_@Amount Requested.id@','Amount Requested cannot exceed $100,000');
}</pre>
 
====Application Name field black====
<pre>if(form.getStr("sf_Application Name") == "")
2,004
edits

Navigation menu