Important Update: Community URLs redirect issues are partially resolved. Learn More. .
2023-04-12 05:41 AM
Hi,
We're trying to create our first custom object to pop up a warning message when users click on the Save button. The result is nothing happens when we click on the button. Our code is as below:
<script type="text/javascript">
// Hijack Save/Apply Buttons
$('#master_btnApply1, #master_btnApplyIcon').unbind('click').prop("onclick", null).click(function(){ StatusCheck('Apply');return false;})
$('#master_btnSave1').unbind('click').prop("onclick", null).click(function(){ StatusCheck('Save');return false;});
function StatusCheck(type) {
StatusValue = $('#master_DefaultContent_rts_s315_f26132c').text();
if(StatusValue == 'Assigned') {
WarningAlert("msgText","msgTitle");
} else {
SaveApply(type);
}
}
function SaveApply(action) {
if (action == 'save') {
ShowAnimationAndPostback('master_btnSave1' + action);
} else if (action == 'apply') {
ShowAnimationAndPostback('master_btnApply1' + action);
}
}
</script>
Please help to fix it.
Thank you.
2023-04-12 09:13 AM
@kietnguyen it's always best to add console.log() to your code and use the browser developer tools console so you can see where it is when it fails.
Advisory Consultant
2023-09-11 11:32 AM
Did you get this to work?