- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2014 10:32 AM
I am playing around with a new True/False element on my Incident form, that simply asks the end user who is using the Incident form, "Has the location been verified?". I went to True/False, because this is the only way I could find to get a check box on the Incident form.
In brief, I want the end user to Check this True/False, thus making it True, when they have confirmed the customer's location. Because this True/False is a boolean, I have not seen an easy way to make it Mandatory (because what is mandatory in true and false?), so I was wondering if I could use a Client Script that checks if the value of this True/False to be True, and not False, when the page is saved/submitted etc? Any other good way to do this?
Much thanks.
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2014 01:36 AM
Hi Shane,
I have tried similar things and I always switched to a standard string field with Yes/no as a choice list. This way you can have the the default to 'nothing' and thus forcing the user to select either yes or no.
Regards,
Daniel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2014 05:04 PM
The dictionary value can be set by default to false in the dictionary on the task table (or wherever you put this field).
Depending on when your process dictates a verified location and how long that verification lasts will dictate whether you need to reset the value every time the form loads. If you want to verify the location on the creation of the record only, then you won't need to do anything to make that happen (since your default value is false. Also, I think the default is false anyways if you don't set one on a true/false, so you might not even need to do that).
If you want to verify the location every time an update is made to the record, then you're going to need to reset the value after every submit. You might consider inserting a line:
g_form.setValue('u_location_verification', 'false');
At the very end since you've made your check and you're not interrupting the submit. Reset the value prior to saving so the verification never gets saved.
Even still, I would think as long as the location is verified once, you should be verified forever, so you may not want to reset your checkbox once submitted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2014 03:01 PM
You're correct in saying this would only be on when the status is still a New state. Once the incident is submitted and becomes Active, it should already be in the state of the confirmation being confirmed.
I have set the dictionary to have the option as default False, and removed the "is not" condition from the script (as it was checking the default state of the form):
function onSubmit(){
var locVerified = g_form.getValue('u_confirm_location'); //this is your true/false field name
if(locVerified){ //Default for the variable is False. This checks if it is still False, or has been switched to True.
alert('Please ensure to verify the location with the customer.');
return false; //if we return false, then the update/submission of the record will be aborted
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2014 03:05 PM
Maybe just a typo in your post, but:
if(locVerified)
Will not run the alert if the location hasn't been verified. You would need to do:
if(!locVerified)
Which, if locVerified is false, that would evaluate true, and then run your alert and stop the submission.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2014 03:08 PM
If I do (!locVerified), it doesn't work. Removing the ! seems to make it work.
The dictionary entry has the "Default Value" as "False" currently, could this be why?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2014 03:10 PM
Try lower case false in the default value.