Cancel button on Record producer

sidarth
Giga Expert

There is a Cancel button on record producer which appears if we select the "Can cancel" checkbox.

I want the user to be redirected to a certain link when the "Cancel" button has been clicked. So far I have been unable to find from where the code of the cancel button is coming.

Do help me out.

1 ACCEPTED SOLUTION

Yes, window.open with "_parent" option is redirecting to another page.



cancel_button.setAttribute("onclick","window.open('https://www.google.com','_parent');return false;");


View solution in original post

17 REPLIES 17

ramireddy
Mega Guru

Seems no other way through standard. If this record producer is created through catalog item, you can use "Catalog client scripts". Create a new catalog client script, select corresponding catalog item, implement onLoad event. In the onload event, you can write script like below.



function onLoad() {


    //Type appropriate comment here, and begin script below


 


cancel_button.setAttribute("onclick","location.assign('your url');return false;");

}


It is not working. After clicking on cancel button all I see is a blank screen.


Hi Sidarth,



In that "your url" place, put the URL you want user to redirect to. Even then it it didn't work, put a sample alert before the location.assign() statement.



Thanks


Rami Reddy


I already tried both things. Alert is coming but the page is not redirecting to the URL


Can you check URL is correct?



Following statement is taking me to Incident list on click of CANCEL button.



cancel_button.setAttribute("onclick","location.assign('incident_list.do');return false;");