- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 10:03 AM
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?
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';
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 10:10 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 10:10 AM
Increase the max length on the dictionary of conditions field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 10:22 AM
Thanks Abhinay. I didn't know we could increase the field capacity for default tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 10:13 AM
We hava a length limitation.It seems condition accepts 254 characters.You can edit the length from dictionary inline edit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 10:15 AM
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();