Jiwa then goes & adds the item(s) to the sales order.
I am using the event
- Code: Select all
SalesOrder.SalesOrderLines.Adding
- Code: Select all
throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException
What I'd like to do (after displaying a warning to the user) is to skip over adding that item & continue to add the other items.
If I use SalesOrderLines.Remove(item) it displays an error because (I assume) the item hasn't been added yet to the lines collection.
I wonder is there a better way to do it?
Maybe within the Search window I can do the check so the item never even gets to be added? Although I don't favour that as they can avoid by just typing directly into the SO line.