
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2023 12:44 PM
Basically I have a workflow where a first task is created. Then an IF block is created, and this IF validates a task field called "u_action". If the value of the field is "u_parameter", it creates a new task called "Parameter", if it is "u_normal", it creates a task called "Normal".
I'm using GlideRecord, and it's always returning "no" regardless of what I choose in the field.
// This script needs to set answer to 'yes' or 'no' to indicate the state of the activity.
//
// For example,
//
answer = ifScript();
function ifScript() {
var gr = new GlideRecord("x_hwgs_cap_task");
gr.addQuery("parent", current.sys_id);
gr.addQuery("u_action", "u_parameter");
gr.query();
if (gr.next()) {
return 'yes';
}
return 'no';
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2023 12:59 PM
try adding the operator to the second query for your glide --> gr.addQuery('u_action', '=', "u_parameter")
...also, it seems like you're comparing the value of u_action is either going to be u_parameter or not (it doesn't really check for u_normal)...it seems odd that the value of a property is a string of text that looks like a custom variable...."u_something"...to be clear you're manually setting that value of "u_action" to literally be the string text "u_parameter" (not the value of another custom variable called "u_parameter", correct?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2023 12:59 PM
try adding the operator to the second query for your glide --> gr.addQuery('u_action', '=', "u_parameter")
...also, it seems like you're comparing the value of u_action is either going to be u_parameter or not (it doesn't really check for u_normal)...it seems odd that the value of a property is a string of text that looks like a custom variable...."u_something"...to be clear you're manually setting that value of "u_action" to literally be the string text "u_parameter" (not the value of another custom variable called "u_parameter", correct?)