I have added a customer balance summary screen to the SOP Entry screen using VS C#. On this screen is displayed a summary of the customer's current activity plus there is check box indicating if the selected customer has any past due invoices. If this box is checked I want to stop the user from entering a new order for this customer. I believe I need to use the ValidateBeforeOriginal event but how do I set this up? As a test I inserted this code but it never fires.
void CustomerNumber_ValidateBeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e)
{
MessageBox.Show("Hello world!");
e.Cancel = true;
}
I also tried this
SopEntryForm.SopEntry.CustomerNumber.ValidateBeforeOriginal += new EventHandler(CheckPastDue);
but this won't even build.
What is the proper way to stop a user from entering an order if they have past due invoices. I need to rollback the GP events but how do I do that?