- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2016 06:58 AM
Hi,
In Problem,i have created the one reference field for change request based on if change required is YES and Problem state is resolved then the attached
change should display in related list->change request tab.
I have written below business rule but its not pushing to the change request in related field.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var rec = new GlideRecord('change_request');
rec.initialize();
rec.change_request = current.rfc;
rec.task = current.sys_id;
rec.insert();
})(current, previous);
Please help me to do this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2016 08:35 AM
It worked for me. Please check your work closely to my notes.
I added this Change Request -> Parent list on my related lists.
And here's the complete business rule used to trigger the script:
If that doesn't work, check your permissions closely to make sure the tester has create and write permission on the change_request table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2016 04:58 AM
For maximum effectiveness and best community etiquette, please mark one of my responses above as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Open the new requirement in a new discussion thread so others will see it as new and unanswered.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 02:42 PM
This worked perfectly for me. I'd mark it as answered if I could. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2017 01:10 PM
Hi Chuck,
Seems like a slick solution; I have a similar requirement, whereby I am providing users the ability to create a change request from a problem via a UI Action. However the Change Request related list mentioned by Vivekanand does not auto populate with the change. To my understanding I need to set change.parent to the sys_id of the problem I am relating the change to. But my UI action isn't functioning as I want, and updating the related list. Do I need a separate BR like Vivekanand or can I do it in the UI action script?
Thanks in Advance,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2017 04:43 AM
Hi Robert,
Is the change request getting created and just not linked?
Also, check line 13. I think it should be:
current.rfc = changeRequest.getUniqueValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 10:56 PM
