Hi. I have an urgent requirement to make vendor bank details non - editable once in. I have a workflow on the vendor card for changes so if someone changes the preferred bank code it will need to be authorised.
The theory is to make vendor bank details error if the account number is changed but if it is a new record allow them to be entered. Then on the payment journal make it so that changes to the preferred bank account can not be edited and must come from the vendor card. (I was thinking make this field not visible on the journal - if they can't get to it they can't edit it.)
I have tried by creating a boolean for a new record. The using the OnValidate check if it is a new record - if it is exit, if not error.
I have tried with a table extension(first with no success) using the OnBeforeInsert trigger to set NewRec true and then on a page extension using the OnOpenPage to do the same.
I have put the code below: The result is I can't edit the Bank Account number on an existing record - when you navigate away from the page it gives the error message which is what I wanted, but I can't edit the bank account number on a new record either! Can someone point me in the right direction? It appears to me that my variable NewRec never gets initialised. Please help!
		

Report
 All responses (
 Answers (