Has anyone experienced a situation where calling the noYes or yesNo prompt fires both the true and false callbacks at the same time without any user interaction? I am working on a mod in OEES to support freight charges and package detail additions using the shipping API. I've overridden the shipunship() method in the master controller and instead wrote my own function that first prompts to verify the user wants to ship or unship the OEs that are selected. In the example below, when the "SHIP/UNSHIP" button is clicked this custom function executes, the console is written to with "custom do not ship" or "custom do not void" and the mst.zShipPackages or mst.zVoidPackages also gets called. All before I even have a chance to interact with the pop-up message.
mst.zCustomshipunship = function () {
var zMyOrders = GridService.getSelectedRecords(base.grid);
zMyOrders.forEach(function (row) {
if (row.stagecd <= 2) {
// we need to ask if they want to ship since we are not using the shipunship function from core
MessageService.noYes("Question",
"Ship this order?",
console.log("Custom do not ship"),
mst.zShipPackages(row)
);
} else {
if (row.stagecd == 3) {
// we need to ask if they want to unship since we are not using the shipunship function from core
MessageService.noYes("Question",
"UnShip this order?",
console.log("Custom do not void"),
mst.zVoidPackages(row)
);
}
}
});
};