Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Warning popup when click Save or Save and Close

kietnguyen
Contributor II

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.

2 REPLIES 2

DavidPetty
Archer Employee
Archer Employee

@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

Rlowen
Contributor II

Did you get this to work?