- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2015 08:51 AM
Hi,
I have a record producer form that feeds the Change Request table. On the form there is a Lookup Select Box variable that references a custom "Keyword" table and an Assignment Group field that references the sys_user_group table. I named the Assignment Group variable the same as what it's named in the Change Request form, in order to use the Record Producer functionality and carry over the value to the Change Request form. I will eventually add a UI Policy to "hide" the Assignment Group field, as the requester doesn't need to see it.
My issue is I can't figure out a way to set the Assignment Group if the requester selects "Keyword Not Listed" from the Lookup Select Box "Keyword" Variable. I have attached a screen shot of the form. Any assistance would be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2015 10:28 AM
I am not seeing any attachment with your last post, however, I have update my code
getDisplayValue is corrected to getDisplayValue()
if(producer.'name of your drop down variabve'.getDisplayValue() == 'Keyword Not Listed')
{
current.assignment_group = 'sys_id of the group';
}
else if // do here for other conditons simirlay.
{
}
I posted the corrected code, can you try with this and check?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2015 11:42 AM
Hello Mike,
Kindly mark post as correct / helpful / like if it answered your query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2015 11:36 AM
Actually it is printing the same keyword you are looking for.
Don't know why it is not getting in the loop since printed value is same as we are comparing with.
Can you try to modify the code to below and check again
if(producer.'name of your drop down variabve'.getDisplayValue().toString() == 'Keyword Not Listed')
{
gs.log('Mike I am in loop :' + producer.'producer.'name of your drop down variabve'.getDisplayValue().toString()');
current.assignment_group = 'sys_id of the group';
}
else
{
gs.log('Mike I am out of loop:' + producer.'producer.'name of your drop down variabve'.getDisplayValue().toString()');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2015 12:03 PM
When I added the open and closed parenthesis after getDisplayValue(), the log now shows that keyword is "in the loop" and "out of the loop". The log only showed "out of loop" without the parenthesis. I added the Assignment Group to the log as well now. The Assignment Group is getting added after the IF and it is properly assigning to the correct assignment group on the Change Request. I attached the log files. Thank you again. I will mark the script you included above as the Correct Answer.