EpiViewNotificaion.AddRow Cancel after Validation?

I have a request to validate some information on the order when adding rows to the Sales Order Pick List filter.
If the validation fails, they want a warning stating the reason and to prevent the user from adding that row to the filter. I have the validation and message part, but I’m drawing a blank on how to stop that row add.

What about changing the message to an exception?

throw new Ice.BLException("You done messed up, A-A-Ron.");

(sorry - couldn’t resist :wink:)

I just tested this on an EpiViewNotification.AddRow event and it kills the row being added.

1 Like

This is what I ended up going with:

private void orderList_DataView_ListChanged(object sender, ListChangedEventArgs args)
{
	// ** Argument Properties and Uses **
	// orderList_DataView[0]["FieldName"]
	// args.ListChangedType, args.NewIndex, args.OldIndex
	// ListChangedType.ItemAdded, ListChangedType.ItemChanged, ListChangedType.ItemDeleted, ListChangedType.ItemMoved, ListChangedType.Reset
	// Add Event Handler Code

	for( int i = 0; i < orderList_DataView.Count; i ++ )
	{
		if( (bool)orderList_DataView[i]["OrderHeld"] )
		{
			MessageBox.Show("Order " + orderList_DataView[i]["OrderNum"].ToString() + " is on shipping hold and has been removed from your selection.");
			orderList_DataView.Delete(i);
		}	
	}
}
1 Like

I liked the A-A-Ron. one, because of the message.