I have a screen called Transaction Entry.
When a certain criteria on a related Sales Order is not met, Transaction Entry should be read-only. And I’d like to let the user know that the condition on the Sales Order has not been met.
Currently I’m using RowSelected to test for the condition on the Sales Order. If it fails, then I’ve been setting e.Cache.AllowUpdate = false. In addition, I have been setting:
e.Cache.RaiseExceptionHandling<MyDac.transactionNbr>(e.Row, e.Row.TransactionNbr, new PXSetPropertyException(“Condition failed”))
I’ve used this elsewhere so that the user can see the red X and know why they can’t edit the record.
BUT
Since RowSelected is fired while I’m creating the record when the Sales Order condition hasn’t been met, my code is throwing the exception.
So, is there a more correct way to alert the user when they pull up a record as to why they cannot edit the record?
At this point it feels like it will be easier to create a PXAction button that I can show/hide and give it a meaningful caption for the user. But I wonder if there’s an issue with my design or that I’m missing a better way to do that within the framework.
Best answer by darylbowman
View original