Crow Canyon Software Forum
How to display a confirm box when entering a custom action.
Quote from skigeek on December 23, 2024, 4:34 pmI have a form where the employee needs to enter an amount, Once they have entered the amount they will press the custom submit button. The problem is that I want to display a confirm message prior to it being submitted. I have tried putting a confirm but even when I do a functionCallBack(true); the custom action still gets triggered. What Can I do to prevent the custom action from being called if the java confirm returns a false.
function(spContext, formContext, listColumnsInfo, currentItem, functionCallback) {var ActualCost = formContext.fetchColumnValueUI("ActualCost");
if (ActualCost == 0) {
if (confirm(window.confirm("You are submitting 0 dollars for your Actuals.\nIs this correct?")) == true) {
functionCallback();
}
else {
functionCallback(true,"");
}
} else
functionCallback();
I have a form where the employee needs to enter an amount, Once they have entered the amount they will press the custom submit button. The problem is that I want to display a confirm message prior to it being submitted. I have tried putting a confirm but even when I do a functionCallBack(true); the custom action still gets triggered. What Can I do to prevent the custom action from being called if the java confirm returns a false.
var ActualCost = formContext.fetchColumnValueUI("ActualCost");
if (ActualCost == 0) {
if (confirm(window.confirm("You are submitting 0 dollars for your Actuals.\nIs this correct?")) == true) {
functionCallback();
}
else {
functionCallback(true,"");
}
} else
functionCallback();
Quote from supportTeam on January 10, 2025, 3:08 pmHi Archie,
Please use the provided script and let us know the results, this will prevent the custom action from being invoked if it returns as false
var ActualCost = formContext.fetchColumnValueUI("ActualCost");
if (ActualCost == 0) {
if (window.confirm("You are submitting 0 dollars for your Actuals.\nIs this correct?") === true) {
functionCallback();
}
else {
functionCallback(true," ");
}
}functionCallback();
Hi Archie,
Please use the provided script and let us know the results, this will prevent the custom action from being invoked if it returns as false
var ActualCost = formContext.fetchColumnValueUI("ActualCost");
if (ActualCost == 0) {
if (window.confirm("You are submitting 0 dollars for your Actuals.\nIs this correct?") === true) {
functionCallback();
}
else {
functionCallback(true," ");
}
}
functionCallback();