[solved] Avoid double entry
SV_Will
Member Posts: 12
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
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
-
Use a second record variable to check for the value in the tableThere are no bugs - only undocumented features.0
-
Hi bbrown,
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...0 -
SV_Will wrote:Hi bbrown,
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();There are no bugs - only undocumented features.0 -
thanks so far, but still not working. I changed
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.
???0 -
If Seriennummer is a field in the table and this is where the data is entered you do not need SNRcheck. The source for the textbox is Seriennummer.
Versand2.SETRANGE(Seriennummer,Seriennummer);
IF NOT Versand2.ISEMPTY THEN
ERROR('Test');
Call this from the OnValidate trigger of the Seriennummer field of the table.There are no bugs - only undocumented features.0 -
Thanks a lot !!!!0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions