- 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:16 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 09:28 AM
You are good for single line text.
But, for select box, you need to match select box choice value in your setValue().
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 09:34 AM
The values are not being set because the code is trying to set a value to a readonly field. It's necessary to set readonly to false before setting the value to it.
g_form.setReadOnly('vrm_new_satellite_street', false);
g_form.setReadOnly('vrm_new_satellite_city', false);
g_form.setReadOnly('vrm_new_satellite_country', false);
g_form.setReadOnly('vrm_new_satellite_province', false);
g_form.setReadOnly('vrm_new_satellite_postal_code', false);
g_form.setReadOnly('vrm_new_satellite_state', false);
g_form.setReadOnly('vrm_new_satellite_zip_code', false);
g_form.setReadOnly('vrm_new_satellite_other_country', false);
g_form.setReadOnly('vrm_new_satellite_phone_number', false);
g_form.setValue('vrm_new_satellite_street', street);
g_form.setValue('vrm_new_satellite_city', city);
g_form.setValue('vrm_new_satellite_country', country);
g_form.setValue('vrm_new_satellite_province', province);
g_form.setValue('vrm_new_satellite_postal_code', postalCode);
g_form.setValue('vrm_new_satellite_state', state);
g_form.setValue('vrm_new_satellite_zip_code', zipCode);
g_form.setValue('vrm_new_satellite_other_country', otherCountry);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 10:14 AM
You can programmatically set the value of a read-only field, so that's not the issue, but in terms of logic, it would make sense to flip the order of the operations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 09:46 AM