Cannot add parameters to the condition field on UI action

deepthireddy
Kilo Expert

Hi all,

I'm trying to add more parameters to the condition field on global UI Action 'New' but it is not allowing me. Tried to add the condition in the script at the beginning but it's redirecting me to some other page on clicking that button. Guess the condition field has a field limit.

Here's the global UI action i want to add more parameters to, how do i solve this?

find_real_file.png

Script:

var uri = action.getGlideURI();

  var path = uri.getFileFromPath() + '';

  path = path.substring(0, path.length - 5) + '.do';

  uri.set('sys_id', '-1');

  path = checkWizard(uri, path);

  if (path)

  action.setRedirectURL(uri.toString(path));

  action.setNoPop(true);

  function checkWizard(uri, path) {

  var already = uri.get('WIZARD:action');

  if (already == 'follow')

  return null;

  var wizID = new GlideappWizardIntercept(path).get();

  if (!wizID)

  return path;

  uri.set('sysparm_parent', wizID);

  uri.deleteParmameter('sysparm_referring_url');

  uri.deleteMatchingParameter('sysparm_list_');

  uri.deleteMatchingParameter('sysparm_record_');

  uri.deleteParmameter('sys_is_list');

  uri.deleteParmameter('sys_is_related_list');

  uri.deleteParmameter('sys_submitted');

  uri.deleteParmameter('sysparm_checked_items');

  uri.deleteParmameter('sysparm_ref_list_query');

  uri.deleteParmameter('sysparm_current_row');

  uri.set('sysparm_referring_url', uri.toString());

  uri.deleteMatchingParameter('fancy.');

  uri.deleteMatchingParameter('sys_rownum');

  uri.deleteMatchingParameter('sysparm_encoded');

  uri.deleteMatchingParameter('sysparm_query_encoded');

  uri.deleteParmameter('sysparm_refer');

  return 'wizard_view.do';

  }

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Increase the max length on the dictionary of conditions field.


View solution in original post

5 REPLIES 5

Abhinay Erra
Giga Sage

Increase the max length on the dictionary of conditions field.


Thanks Abhinay. I didn't know we could increase the field capacity for default tables.


prasad48
Tera Guru

We hava a length limitation.It seems condition accepts 254 characters.You can edit the length from dictionary inline edit


Kalaiarasan Pus
Giga Sage

The easiest way to do this is to make use of a script include



Create a script include and add a function that contains the condition you want to add to the UI action.



functionname: function(){


if(UI Action Condition)


{


return true;


}


else


{


return false;


}


}



Now call this script include's function in UI action condition



new scriptincludename().functionname();