- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 10:16 AM
Is there an OOTB method to direct users to a Record Producer when they click the New button on a related list, or is only achieved through an onLoad Client Script and use g_navigation.open method?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 10:56 AM
There are many approaches, if you want to redirect only when clicking New button in a related list then you can create "New" UI Action on that table with Action Name "sysverb_new" to override the existing UI Action, use this as condition to display the UI Action for just Related Lists current.canCreate() && !RP.getListControl().isOmitNewButton() && RP.isRelatedList() && !RP.isManyToMany() and in script you can redirect to the Record Producer using action.setRedirectURL(recordProducerUrl);
If you want to redirect everywhere in the Platform UI then use Navigation Handler. Refer this documentation for details about Navigation Handler and use below sample script
(function() {
var recordProducerUrl = '';
var sysId = g_request.getParameter('sys_id');
if (gs.nil(sysId) || !isValidRecord(sysId))
return g_uri.toString(recordProducerUrl));
return "";
})();
function isValidRecord(sysId) {
var gr = new GlideRecord(your_table);
return gr.get(sysId);
}
Regards,
Rajesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 10:56 AM
There are many approaches, if you want to redirect only when clicking New button in a related list then you can create "New" UI Action on that table with Action Name "sysverb_new" to override the existing UI Action, use this as condition to display the UI Action for just Related Lists current.canCreate() && !RP.getListControl().isOmitNewButton() && RP.isRelatedList() && !RP.isManyToMany() and in script you can redirect to the Record Producer using action.setRedirectURL(recordProducerUrl);
If you want to redirect everywhere in the Platform UI then use Navigation Handler. Refer this documentation for details about Navigation Handler and use below sample script
(function() {
var recordProducerUrl = '';
var sysId = g_request.getParameter('sys_id');
if (gs.nil(sysId) || !isValidRecord(sysId))
return g_uri.toString(recordProducerUrl));
return "";
})();
function isValidRecord(sysId) {
var gr = new GlideRecord(your_table);
return gr.get(sysId);
}
Regards,
Rajesh