Adding watchlist catalog item varible ritm

sakila
Tera Contributor

I have requriement in add the watchlist catlog item variable in ritm

For example 

Caylog item variable is

Add user to the ritm filed- reference filed

If I selected one user in this filed after sumitting ritm in that ritm watchlist need to add that user name, which I selected from catlog item variable. 

Any one help here

 

 

 

1 ACCEPTED SOLUTION

I'm not clear weather you are saying this is or is not working.  It's unnecessary lines of code and value manipulation as a List Collector variable stores a comma-separated list of sys_ids, as does the watch_list which is a List type field, so a direct value assignment as I suggested will work fine in this case.

View solution in original post

7 REPLIES 7

Brad Bowman
Kilo Patron
Kilo Patron

If I'm following correctly, you'll want to create a List Collector type variable (to allow selection of more than one user) or a reference type variable (to allow the selection of only one user).  Since it sounds like this selection will be made on the request form, you can copy the selection(s) to the RITM watchlist by creating a before Insert Business Rule on the sc_req_item table.  The Script in the Advanced section would just be something like

current.watch_list = current.variables.var_name;

where var_name is the name of your variable.

 

Thanks . 

in business rule tried when to run selected before and insert now working expected same. 

(function executeRule(current, previous /*null when async*/ ) {
    var reqFor = current.variables.var_name;
    var wlArray = [];
    if (reqFor != '') {
        wlArray.push(reqFor.toString());
        current.watch_list = wlArray.toString();
    }
})(current, previous);

 

I'm not clear weather you are saying this is or is not working.  It's unnecessary lines of code and value manipulation as a List Collector variable stores a comma-separated list of sys_ids, as does the watch_list which is a List type field, so a direct value assignment as I suggested will work fine in this case.

Thanks