Hi there,
got a small problem. Created a Form - the User selects a delivery No (L123456) and enters Data (SNR from our products).
It should not be possible to enter the same SNR within 2 delivery No. Thought of "testfield" but how to say the value you just entered compare with the values of the whole table and deny entrie if its already there??? (Can not use the key)
Cheers
Will
0
Comments
do you mean record variable for SNR or for my table. I tried
Form - OnAfterGetCurrRecord()
Seriennummer := SNRcheck;
"Prod. Versand Line".TESTFIELD (Seriennummer,SNRcheck);
Not working...
A record variable for the table. Isn't Seriennummer a field in that table?
RecVar2.SETCURRENTKEY(a good key)
RecVar2.SETRANGE(Seriennummer,SNRcheck);
IF NOT RecVar.ISEMPTY THEN
ERROR();
Seriennummer := SNRcheck;
Versand2.SETRANGE(Seriennummer,SNRcheck);
IF NOT Versand2.ISEMPTY THEN
ERROR('Test');
Versand2 is my second variable for the table. The table contains only one key so I dont need this line. The User inserts Seriennummer which is a field in my table. I created a form with a subform. The code is in the subform Trigger: Form - OnAfterGetCurrRecord()
SNRcheck is just a global variable code 20 for the current data entry.
???
Versand2.SETRANGE(Seriennummer,Seriennummer);
IF NOT Versand2.ISEMPTY THEN
ERROR('Test');
Call this from the OnValidate trigger of the Seriennummer field of the table.