Monday, May 6, 2019

Open a new tab/window after pressing a button

It is possible to open a new tab/window with specific URL in browser after hitting a button.

Save button
- Type: Client Side
- Trigger: Save Record

function saveRecord(){

window.open('https://www.google.com/', '_blank');
return true;

}

Custom button
- Type: User Event
- Trigger: Before Load

function beforeLoad(type, form){

var script = "window.open('https://www.google.com/', '_blank');";
form.addButton('custpage_button_reject_reason', 'TEST', script);

}

Note
Type of the opening instance (new window/tab) depends on browser's settings and cannot be covered by a script.

2 comments: