Access request item variables through client script

manredd
Kilo Expert

function onChange(control, oldValue, newValue, isLoading) {

if (isLoading) {

  return;

}

var Emp = new GlideRecord('sc_req_item');

Emp.addQuery('sys_id', newValue);

Emp.query();

while(Emp.next()) {

  g_form.setValue('u_first_name', Emp.variables.u_first_name);

    }

}

i used this code but this gives me undefined in my coloumn

1 ACCEPTED SOLUTION
14 REPLIES 14

its not a table its catalog client script


OK. Thank you. If you could provide additional details on what you are trying to accomplish (more details are better, pictures are particularly helpful) then the community may be of additional service.



Thank you


copy the request item variables to current catalog form. so that if the catalog form is rejected user can select the old form and instead of refilling the details


so old form values can be refilled to new form


Ishant Goyal1
Tera Contributor

This is because you cannot use dot references in Client scripts.


Also there is not column names variables in Request Item table. The variables linked to a RITM and their answers are stored in a different table named Variable Ownership.


If you can give me the exact requirement of what you are trying to achieve here, then i can help you with an appropriate solution for the same.


copy the request item variables to current catalog form. so that if the catalog form is rejected user can select the old form and instead of refilling the details


so old form values can be refilled to new form