How to access a variable on a catalog task?

PranavSuj96
Mega Expert

Hello all,

I am writing an onSubmit script which will not allow the user to close the task if a variable from the catalog item that I display on the catalog task (I display it by selecting it in the workflow using the slushbucket). I tried using g_form.getValue('variables.variable_name'). This seems to not work...

 

Any ideas why? I'll post the script below. Also the onsubmit script is also preventing saving/updating..

Script:

function onSubmit() {

 if(g_form.getActionName('close_task') && g_form.getValue('short_description') == 'Precheck for Server Snapshot' && (g_form.getValue('variables.mc_storage')!='false' || g_form.getValue('variables.mc_storage')!='true')) {
  var val = g_form.getValue('variables.mc_storage');
  alert(val.getDisplayValue());
  return false;
 }
 return true;
}

joel_ruiz1
Tera Expert

The variables are located on the RITM not the task, try using parent.variables.variable_name like. 

g_form.getValue('parent.variables.variable_name'). 

Let me know if that works.

-Joel R.

I have not been successful in dot-walking to variables on other forms. Have you tested this?

Just tested. It didn't work. also cca as per your other comment I realized the saving action was not the issue.

Do you have any other ideas?

 

Best,

Pranav

Hey Joel,

 

It is returning blank still unfortunately.