- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 06:48 AM
Hello,
Does your client script also apply on the request item and/or catalog task records?
Within that script on your catalog item, you can select other areas it will also be working on.
For those, it would need to have onLoad functionality versus just onChange (with no onLoad ability).
Essentially, the select-box needs to be populated in other areas of the platform and not just within the catalog item itself.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 06:56 AM
Hi Allen,
It applies on requested item and catalog task records also. And it is onchange client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 06:59 AM
Hi,
As I mentioned above, it would also need to apply onLoad...because the catalog item isn't "changing" on the request item, right?
So when the form is loading, your addOptions aren't loading, thus no display value, thus the back-end value that was previously chosen on the catalog item shows.
Please re-read my post above.
Alternatively, you can reference the selections from another table via a different catalog item variable type and then filter to only specific selections, instead of trying to code everything. However, if your situation is a bit more complex than that would allow, then the way you have it is fine, you just need to compensate for it via an onLoad client script as I've mentioned above.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 06:48 AM
Yes, this is expected one. Keep both label and back value as same in your g_form.addOption() script. So that, user can see readable data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2022 07:13 AM
This occurs when you create options dynamically which don't otherwise exist as options on the select box as, when the record is submitted, the value of the field is set to the value of the option selected, but the display value (label) you passed in is not saved for later reference. When the Editor loads, it therefore displays what was saved in the field.
The easiest solution is to use the same string for both label and value, which would mean you would at least see what you expect.
If that is not an option and you need to reference the backend value (but want to see the display value) you have a few options.
You might look into whether you can use a Lookup Select Box (which lets you set the column to use for the label and the column to use for the value) which would eliminate your issue.
Another option would be to save your backend value and display value to other fields on change, and then as an onsubmit script set the option again using just the display value - that way you would have the backend value to reference, and still see what you expect in the Editor.
I hope this helps!
If this was helpful, or correct, please be kind and mark the answer appropriately.
Michael Jones - Proud member of the GlideFast Consulting Team
Michael D. Jones
Proud member of the GlideFast Consulting Team!