Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

How to display a confirm box when entering a custom action.

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.

function(spContext, formContext, listColumnsInfo, currentItem, 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();