I have copied an event (klicked) and are trying to do a validation of delivery mode, but the original code gets executed fore the validation. (Even though I have breakpoints activated!)
Does any one have any idea why?
class tt042WHSShipmentDetailsForm_Events
{
[FormControlEventHandler(formControlStr(WHSShipmentDetails, btnOutboundShipConfirm), FormControlEventType::Clicked)]
public static void btnOutboundShipConfirm_OnClicked(FormControl sender, FormControlEventArgs e)
{
Dialog dialog = new Dialog();
WHSShipmentTable shipmentTable;
FormDataSource dataSource = sender.formRun().dataSource(formDataSourceStr (WHSShipmentDetails, WHSShipmentTable));
shipmentTable = dataSource.cursor() as WHSShipmentTable;
dialog.addText("@tt_042:ScanDlvMode");
sender.enabled(false);
DialogField validationField= dialog.addFieldValue(extendedTypeStr (RetailDeliveryModeID), "" ,"@tt_042:DeliveryField");
if (dialog.run())
{
if (dialog.closedOk())
{
RetailDeliveryModeID validate=validationField.value();
if (SalesTable::find(shipmentTable.OrderNum).DlvMode!=validate)
{
throw Global::error("@tt_042:ScanError");
}
}
}
}
}