- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2021 10:17 AM
I am creating a Multi-Row Variable Set (MRVS) that will be used in multiple Catalog Items, so I am trying to make it as dynamic as possible.
I have an "Environment" in my MRVS that will need to be filtered based on which application it is for. I have stored the sys_id of the Application record in a Variable in the main Catalog Item (I know I can hard-code it in the MRVS, but then it would not be dynamic!).
So my "Environment" field in my MRVS is a Reference field, and this is what it looks like:
My "application_sys_id" field is at the Catalog Item level, and is a Single Line Text field. I have put the value it needs to be in the "Default" field on this variable, i.e. 7eb3fe1d1...
Now, if I hard code my "Reference qual" like this:
javascript: 'u_active=true^u_application=7eb3fe1d1…'
It works exactly as it should, but it does NOT if I try to use current.variables... I tripled-checked, to make sure that there are no typos in my variable name, and it is correct (so please don't suggest I check that).
I did further tests, to see what would happen if I created the application_sys_id variable right in the MRVS, and it worked fine when I did it there (but defeats the whole dynamic goal). But what that does tell me is that the MRVS does not like to use current.variables... to try to get a variable from the Catalog Item that is using that MRVS.
So, the question then becomes, how can I have my variables in MRVS call variables from the Catalog Item that is using them?
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2021 12:02 PM
The short answer is you can't. A workaround would be to add a variable to the MRVS that is a reference on the same table as the catalog item variable, then you can have an onLoad script within the MRVS populate the MRVS variable from the catalog item variable, and make it read only. In Quebec and later you will be able to hide this extra variable, and may not even need it as the interaction between the MRVS and catalog item is said to be improved, but I don't know if this specific use case is addressed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2021 12:02 PM
The short answer is you can't. A workaround would be to add a variable to the MRVS that is a reference on the same table as the catalog item variable, then you can have an onLoad script within the MRVS populate the MRVS variable from the catalog item variable, and make it read only. In Quebec and later you will be able to hide this extra variable, and may not even need it as the interaction between the MRVS and catalog item is said to be improved, but I don't know if this specific use case is addressed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2021 12:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2021 04:24 AM
I was afraid that might be the case. I had tried using a Script Include too, but that did not work either (as you probably would have guessed!).
Thanks for the replies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 02:02 PM