Sometimes you need to use javascript after click on a button before the APEX validations and processes starts.
(For example you have a report with editable fields and maybe a save button on every row. In these special cases you could need something like that.)
Go on edit Button > URL Redirect > change/add
Target is: URL
URL Target: javascript:BUTTON_ACTION();
Edit Page > HTML Header > add the new javascript
<script language="JavaScript" type="text/javascript">
function RR_ACTION_UPDATE() {
// P1_ACTION field into JS variable
var l_field_id = document.getElementById("P1_ACTION");
// Now you are able to put in every type of code
// example: set value for field l_field_id.value =
// 'UPDATE';
// calculate: l_field_id.value = 5 + 5;
// doSubmit action
doSubmit('DOSUBMIT');
}
</script>
(For example you have a report with editable fields and maybe a save button on every row. In these special cases you could need something like that.)
Go on edit Button > URL Redirect > change/add
Target is: URL
URL Target: javascript:BUTTON_ACTION();
Edit Page > HTML Header > add the new javascript
<script language="JavaScript" type="text/javascript">
function RR_ACTION_UPDATE() {
// P1_ACTION field into JS variable
var l_field_id = document.getElementById("P1_ACTION");
// Now you are able to put in every type of code
// example: set value for field l_field_id.value =
// 'UPDATE';
// calculate: l_field_id.value = 5 + 5;
// doSubmit action
doSubmit('DOSUBMIT');
}
</script>