How to set the default value for form section in an announcement form?

Devi12
Giga Guru

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.

1 ACCEPTED SOLUTION

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 

Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

View solution in original post

5 REPLIES 5

Hello sulabh,

With the above BR a new announcement is defaulting to ESC portal after saving. But, while creating an announcement, before saving if we select any other portal, after saving it is populating both portals. Which is not expected one. So I have given a condition in BR "current.sp_portal.nil()" it is not working. Then I have given if condition as below, then also not working. Can you please help me on this as well.

find_real_file.png