- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 02:49 AM
Hi,
I have requirement that an announcement record should have default portal selected when it is loaded. As it is a section tab I don't know how to configure it. Can any one help me on this?
Attached is the screenshot.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 05:40 AM
Hello,
Create script like below, it should work, Its working for me
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('m2m_announcement_portal');
gr.initialize();
gr.announcement = current.sys_id;
gr.sp_portal = '81b75d3147032100ba13a5554ee4902b';
gr.insert();
})(current, previous);
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg
Regards
Sulabh Garg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 03:28 AM
Hi Devi,
There is a table "m2m_announcement_portal" which stores the relationship between Announcement record and the portal.
You may plan to write a BR/script on "Insert" of Announcement record that will insert a new record in the "m2m_announcement_portal" table with default portal.
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg
Regards
Sulabh Garg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 03:45 AM
I tried, but not able o get the backend value for portal. I have created a before insert BR:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord('m2m_announcement_portal');
gr.initialize();
gr.name = "Test";
gr.portals = '52fa79f8e763320075c2a117c2f6a991';
})(current, previous);
above is the script I have written. I am not sure how can I update "Portal" field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 05:40 AM
Hello,
Create script like below, it should work, Its working for me
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('m2m_announcement_portal');
gr.initialize();
gr.announcement = current.sys_id;
gr.sp_portal = '81b75d3147032100ba13a5554ee4902b';
gr.insert();
})(current, previous);
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg
Regards
Sulabh Garg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 06:22 AM
Thanks for the reply Sulabh Garg!