- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2019 09:18 AM
Hello Guys,
can you please suggest what to do here, in the below code so that things will work fine again .
My Code :
var grProblem = new GlideRecord('problem');
grProblem.initialize();
grProblem.setValue('short_description', 'PRB generated from P1 ' + current.getDisplayValue());
grProblem.insert();
current.assignment_group='Database Atlanta'; // Not working
current.assigned_to='bow.ruggeri@example.com'; // Not working
current.setValue('problem_id', grProblem.getUniqueValue());
current.update();
Thank you in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2019 09:40 AM
hello Bright,
As assignment_group & assigned_to is reference field, you need to pass a sys_id of assignment_group & assigned_to.
current.assignment_group='SYS ID of Database Atlanta'; // Not working
current.assigned_to=' SYS ID of bow.ruggeri@example.com'; // Not working
OR
Try using below code:
current.setDisplayValue('assignment_group','Database Atlanta');
current.setDisplayValue('assigned_to','bow.ruggeri@example.com');
For more details:
Few recommendations:
1. I would recommend to use grProblem.getValue('sys_id') in place of grProblem.getUniqueValue();\
2. If you are using BEFORE BR then No Need to of current.update();
3. If you are using AFTER BR then you can add one more line current.setWorkflow(false); before current.update(); OR Not to use current.update();
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 12:01 AM
Hi Bright,
Please try below code
current.assignment_group.setDisplayValue('Database Atlanta');
current.assigned_to.setDisplayValue('bow.ruggeri@example.com');
Please make helpful/correct, If its applicable for you.
Thanks,
Vinay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 01:04 AM
Hey Thanks Alot, #Vinay Mishra