When I am adding a Sales Order, I have a method For VAT checking.
The method returns data in bool.
If the bool value is False
the Form_DATA_Add the event should not work further it should stop the adding process.
When I am adding a Sales Order, I have a method For VAT checking.
The method returns data in bool.
If the bool value is False
the Form_DATA_Add the event should not work further it should stop the adding process.
You could use the BubbleEvent
bool to handle whether you want the event to actually complete.
private static void OApplication_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo BusinessObjectInfo, out bool BubbleEvent)
{
//Foo as your bool method
if (Foo())
{
BubbleEvent = true;
}
else
{
BubbleEvent = false;
}
}
Something like this should do the trick but I would strongly suggest to use the SBO_SP_TransactionNotification
for things like that. Also manage the BusinessObjectInfo.BeforeAction
bool to determine the exact moment you want the ckecks to trigger, I would suggest to go with BusinessObjectInfo.BeforeAction = true
.