How to get view name in script include and BR?

prasannakumard
Tera Guru

Hi Team,

How to find the view name using BR. Based on view, want to restrict some functionalities.

Actually, based on view change, we are setting Assigned to as logged in user on RITM Form. so, we need to restrict on onchange of views.

 

Please provide any references regarding the same.

 

Thanks & Regards,

Prasanna Kumar

1 ACCEPTED SOLUTION

Sai Kumar B
Mega Sage
Mega Sage

@prasannakumard 

Use the following code in BR to find the view

var view_name='';
if (gs.getSession().isInteractive()) {
var map = gs.action.getGlideURI().getMap();
if (map.get('sysparm_view') != null) {
view_name= map.get('sysparm_view').toString(); //This contains view
}
}

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022

View solution in original post

1 REPLY 1

Sai Kumar B
Mega Sage
Mega Sage

@prasannakumard 

Use the following code in BR to find the view

var view_name='';
if (gs.getSession().isInteractive()) {
var map = gs.action.getGlideURI().getMap();
if (map.get('sysparm_view') != null) {
view_name= map.get('sysparm_view').toString(); //This contains view
}
}

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022