- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 08:57 AM
Hoping somebody can help me figure this out.
I'm creating a form where the user can create a new vendor where they need to fill out a handful of mandatory fields.
Once created, they need to select if the their contract will take place at the same office or not.
This is essentially the same concept of filling out your address and then having a checkbox to confirm if your billing address is the same and will self-populate if you check yes.
Per my alerts I'm getting into the 'if' statement and my values seem to be generating within the statement.
However, when the info is not getting generated on my form, they're simply showing as blank and mandatory. Which is essentially what would happen if they selected 'No' instead of 'Yes' in the Contract location is the same as above' field.
Solved! Go to Solution.
- Labels:
-
Script Debugger
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2020 12:51 PM
Finally figured this one out.
Strange enough, it ended up being a UI policy that simply controlled the visibility of of that particular section.
I tried changing the order of the UI policy and the client script but I couldn't come to any combination between the two that worked for some reason.
I ended up controlling the visibility of that section with a UI policy centered around a different field/condition.
Thank you everybody that took the time to assist/help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 09:59 AM
There are several strategies for debugging client-side scripts:
- JavaScript Log and jslog()
- Field Watcher
- try/catch
- Debugging tools built into web browsers (browser dependent)
You can also use Chrome to debug Client-side errors -- Refer link
To have a detailed overview on the various way to debug, refer to this link.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 03:48 PM
Try moving the 1 remaining statement to above the if statement to make sure it would set the value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2020 07:06 AM
If there's a UI Policy setting the field readonly, try turning that off.
I've been testing setting values in readonly field in my instance and all have failed. While I've been able to set value when I turned the UI Policy off or when I set the readonly to false before setting the value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 10:04 AM
Couple things:
- are you seeing any errors in your browser's console?
- TNT: Screenshots Help, but Code is Better
- TNT: And Formatted Code is Even Better

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2020 06:49 AM
These things I could figure out
- I don't see "populateInfo" method from your screen shot. Normally when you use getReference, you need to use like this
- g_form.getReference('<variablename>', populateInfo);
- function populateInfo(ref){g_form.setValue('<anothervar>', ref.fieldname);}
- Use the boolean like this, it works almost every-time.
- if(exists.toString().indexOf('true') > -1)
- Are you setting any value to the Onchange Variable field? i.e. You wrote Onchange on variable A and you are again setting the value to variable A which will ultimately run the Onchange recursively.
Thanks,
Narsing