Non record values in List Collector

ZachOnNow
Tera Guru

Hello everyone I need help solving a very specific use case. So I have a MRVS with list collector variables. What I am trying to achieve is with the list collectors, a user can select records and also input values that are not records, I know this is not the intended use of a list collector so I understand this a wild achievement to accomplish but it's what we want for our application. Is there maybe another type of variable that would better solve this? I had thought of maybe creating my own custom list collector by creating a custom widget, but Custom type variables are not allowed in MRVS. Any advice/help is very much appreciated!!

On a side note: Is there anyway to have the list collectors automatically expanded or change them to slush bucket instead of glide_list?

4 REPLIES 4

Brad Bowman
Kilo Patron
Kilo Patron

Starting with the side note, an onLoad Catalog Client Script that applies to the MRVS will 'unlock' the list variable.  This uses the verboten DOM manipulation, and only works in the native UI.

function onLoad() {
	window.setTimeout(openUnlock, 2000);
}

function openUnlock(){
	gel('IO:a5e63cc79363b110c7d735018bba10fc_unlock').click();//Use browser tools to inspect the lock icon to get this value
}

After saving the script, uncheck the Isolate script box, or this code will not execute.  You can adjust the timeout value to see if 1000 or 1500 or whatever gives the dialog window enough time to load before attempting the 'unlock'.

 

There is not a way to dynamically add values to a list collector or any other multi-select variable types.  A workaround to this is to add a single line text variable in the MRVS, with some instruction or labelling that makes it clear that this is for additional values.  If you want all of the values to be 'selected' in the list variable for whatever reason, you would need to run a script after the Catalog Item is submitted.  The script would take any values entered here and create a new record for each on the list referenced table, then update the list variable to include the sys_id(s) of the new record(s).  This would be a bit trickier since it's a variable in an MRVS, but still sounds possible. 

Hello Brad, thank you for the response, I set up something similar to what you suggested for the List Collector. Also I have tried doing the catalog client script before and it never works and I have tried multiple ways. I went ahead and tried again but with how you set it up but it still has not worked and I don't understand what I am doing wrong.
Screenshot 2024-03-27 161836.pngScreenshot 2024-03-27 162115.png

I was actually surprised when I tried this inside a MRVS and it did work.  Your setup looks correct to me.  When you click the Add button on the request form, does the Add Row dialog window seem to take awhile to load?  You could try increasing the wait time from 2 seconds (2000) to 5 (5000) then go back from there if that works.  Do you have any other onLoad Catalog Client Scripts that apply to this MRVS?  Is the variable visible and not read only when the Add Row dialog window loads?  I'm on Vancouver - not sure if that matters.

 

Here is an alternate script, also using DOM, that is working for me too:

function onLoad() {
	var var1 = g_form.resolveNameMap('variable_name'); //mrvs variable name
	setTimeout( function() {
		$(var1+'_unlock').click();
	}, 5000);
 }

 

Yeah I'm on Washingtion DC, maybe they patched this trick in the update? Add row loads up normally but I went ahead and tried 5000 ms and it still did not work.