
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2021 01:43 PM
I have a true/false field. I need to see the value so I can do an If script when it is true.
If I do: var ip = g_form.getValue('u_ip');
The alert is blank.
If I do var ip = g_form.getBoolenValue('u_ip');
The alert returns false regardless of it being true or false.
I can't do display value because that gives me the Case Number.
Any magic I am missing.
Thanks,
Stacy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2021 02:05 PM
Hi, syntax looks ok and it works correctly for me if I paste to my instance (after updating the reference field).
Is you field visible on your form?
Is the script 'Active' ?
Is script in correct scope?
If are you domain seperated, is domain correct?
Do you have the correct table selected for the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2021 02:05 PM
Hi, syntax looks ok and it works correctly for me if I paste to my instance (after updating the reference field).
Is you field visible on your form?
Is the script 'Active' ?
Is script in correct scope?
If are you domain seperated, is domain correct?
Do you have the correct table selected for the script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2021 02:15 PM
Hmm good thought cross scope issue. Let me play with that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2021 02:21 PM
Still not working.
So I deleted the true/false field and turned it in to a string field with choices of true or false.
And it still does not work.
The table is in the sn_customerservice_case scope where I added the field to the table and so is the client script.
My alert returns an empty alert.
function onLoad() {
var ip = g_form.getValue('u_ip');
alert(ip);
if (ip == true) {
alert("Hello World");
}
}
??Dazed and Confused??
Stacy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2021 02:48 PM
Very odd indeed, as the code is simple enough, Do you see any errors in browser console
You could add debug message to the first line, just to confirm the script is actually (not) running.
g_form.addInfoMessage("is this running');
You will need to make your 'true' condition 'text', but you should still get the first alert regardless.
if (ip == 'true') {

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2021 02:57 PM
You are right the problem is because the field is not on the form.
Thanks,
Stacy