Multi purpose use search form
Rani_Shoura
Member Posts: 15
Hello Forum,
I have a tricky thing to do arround, I'm working on a Customized Handheld terminal Application with Navision, now the application is almost done, the users are requisting to have a barcode alternative using search screens.
Now I have to create something arround 15 forms "PDT size" only for that purpose, is there is any way to have the following:
Have one generic form for searching where I pass the recordset might be a sales header, purchase header, item list, Lot Nos
[-o<
I have a tricky thing to do arround, I'm working on a Customized Handheld terminal Application with Navision, now the application is almost done, the users are requisting to have a barcode alternative using search screens.
Now I have to create something arround 15 forms "PDT size" only for that purpose, is there is any way to have the following:
Have one generic form for searching where I pass the recordset might be a sales header, purchase header, item list, Lot Nos
[-o<
0
Comments
-
You can have form to only get the barcode from the user and than you can search all the tables you want for the relevant record and open the appropriate form with it.0
-
kine wrote:You can have form to only get the barcode from the user and than you can search all the tables you want for the relevant record and open the appropriate form with it.
Thanks for the reply, it looks that I didn't describe my self well, all the barcode scanning and logic is done, but sometimes, for various reasons, there will be no barcodes and orders with the user so I have to give him a select from a list function, now I have like 7 fields which are scanned, and I don't want to have 7 forms "Saving
" so I need to have one form with a table box where I can bind to different data sets, where user will get the Ok Cancel buttons and select a key.
Regards0 -
Just base the form on some temporary table having the code as primary key or create your own, which you will fill by the values from table you need. It could be done, I am using it already... :-)0
-
kine wrote:Just base the form on some temporary table having the code as primary key or create your own, which you will fill by the values from table you need. It could be done, I am using it already... :-)
Hi Kine,
Thank for your prompt response, can you shade some light on the "which you will fill by the values from table you need".
Thanks a million0 -
Assume, that you have table with fields "Code" and "Description". Than you can create form (will be read-only) and add this code:
----------------- OnOpen RecRef.OPEN(BaseTableID); //table, from which you want to take the values RecRef.FIND('-'); ----------------- OnFindRecord FieldRef := RecRef.FIELD(CodeFieldID); //ID of the field with the code value in the base table FieldRef.VALUE := Code; FieldRef.SETFILTER(GETFILTER(Code)); FieldRef := RecRef.FIELD(NameFieldID); //ID of the field with name in the base table FieldRef.VALUE := Description; FieldRef.SETFILTER(GETFILTER(Description)); Result := RecRef.FIND(Which); FieldRef := RecRef.FIELD(CodeFieldID); Code := FieldRef.VALUE; FieldRef := RecRef.FIELD(NameFieldID); Description := FieldRef.VALUE; EXIT(Result); ---------------- OnNextRecord FieldRef := RecRef.FIELD(CodeFieldID); FieldRef.VALUE := Code; FieldRef.SETFILTER(GETFILTER(Code)); FieldRef := RecRef.FIELD(NameFieldID); FieldRef.VALUE := Description; FieldRef.SETFILTER(GETFILTER(Description)); Result := RecRef.NEXT(Steps); IF Result <> 0 THEN BEGIN FieldRef := RecRef.FIELD(CodeFieldID); Code := FieldRef.VALUE; FieldRef := RecRef.FIELD(NameFieldID); Description := FieldRef.VALUE; END; EXIT(Result);
If you correctly set the values of variable CodeFieldID, NameFieldID and BaseTableID, you have generic for able to open any table which have Code as primary key and some description in another field. You can use some setup table to keep these IDs etc... ;-)0 -
Hi,
I don't have a dev env under my hand now, I'll test it and get back to you, but from what I understand, it's a perfect solution. =D>
Thanks alot.
Have a nice day0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
