Sunday, October 22, 2023

How to redirect page in single button based on condition using javscript

var excelReportValue = $v('P237_EXCEL_REPORT');


// Replace 'YOUR_APP_ID' with your actual application ID

var targetPageId;


if (excelReportValue === '1') {

    targetPageId = '352';

} else if (excelReportValue === '2') {

    targetPageId = '1000';

} else {

    // Handle other cases or set a default page ID

    targetPageId = 'default_page_id';

}


window.location.href = 'f?p=YOUR_APP_ID:' + targetPageId + ':&SESSION.';

No comments:

Post a Comment