
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 01:57 AM
Hey,
SO strange. I need help here!
I have a scoped variable set up as a lookup select box and link to a custom table that contains similar entries like sys_choice ... to be used for the lookup.
I'm using a ref qual condition that works fine when choosing valid entries from the table within a catalog item ... All fine!
No I need for certain cases (depending on a change mad in an other variable) to ADD an OPTION that is NOT part of the table I'm using for my choices.
SO a have a catalog client script on change, that sets the ADDITIONAL option (not matching the ref qualifier) in case required (and I also found an way to remove it again in case the other value changes again ... ).
All works fine ... just the first time the option is to be set, it disappears again! Looks link there would be some other setting redoing what was just done in the catalg client script. I added an alert at the end of the client script and when it pops up the correct value is still there. Just overwritten with blank afterwards.
I 5 times checked ALL client scripts ... none of them can be responsible for overwriting.
And anyhow .. when changing the variable causing it .. back and force it works .. allways ... its JUST the first time this does not work ... anyone with an idea? Look more like a bug to me ...
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 06:10 AM
Table?! We are still talking about variables ..
BUT I found it myself. Its the reference qualifier I'm using to define what kind of values are valid on the lookup select box. This technically is most probably nothing else than a client script. As the values initially are set via the change on an other variable - this will be "loaded" afterwards. So I need to remove the ref qualifyer there and buid in the logic manually within a client script.
Anyhow ! Thnx for your effort!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 02:55 AM
So, you want to set the already selected value before this script has run ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 03:23 AM
The script looks fine and when i try to setValue, it works fine.
How about we try to make the new option the first choice.
1. Dont set --None--
2. modify addOptions field to
g_form.addOption('xxx_variable_B', choiceTmp , choiceTmp, 0);
Do put logs and check the result of 'choiceTmp'.
Is the variable 'yyy_choice_tmp' set with the correct choiceTmp?Do try a console.log(g_form.getValue('yyy_choice_tmp')); to check if the correct value is set

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 03:32 AM
I tried - no difference.
But anyhow - the none need to be set, as choices otherwise always set 1st possible option. And a none is truly an option, need to keep it.
The additional ,0 does not seem to change anything.
And as I said earlier. The option is there! Also on the log.
Just the whole variable is somehow reloaded and the additional option is gone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 03:43 AM
Ok, So here a few points, i can think of that might cause the selected value to disappear
1. the default value of dictionary
2. any other onchange client scripts run on the lookup select variable (since the lookup select variable is changing)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 03:52 AM
Thnx. I'm with you. The default is not set.
But I do not find any other script ... ;-(
And even if there would be one ... when setting the order to 9999 is should run last and should work - no?
It doesn't either ...