DrillDown with RecordRef

efv@inecta.com
Member Posts: 3
Hi there, I am using RecordRef and FieldRef to get values from tables that the user specifies. He enters the table number into a setup table and the field to get the value from. I need to allow him to do a DrillDown with only the Table number to go on. I don't want to create a bunch of Record Variables or Form Variables. And using FORM.RUNMODAL(0); Requires a Record Variable. Is there maby some way I can create a Record Variable on the fly??
Hope somebody can help me out.
Hope somebody can help me out.
Elmar Freyr Vidisson
Navision Attain Certified Programmer
Navision Attain Certified Programmer
0
Comments
-
nope!
Well not yet that is, how knows what the future will bring.
I made a sample one time. Maybe it's off any help.
downloadable here: http://www.mibuso.com/dlinfo.asp?FileID=276"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Thank you for your quick response.
The only thing that is really missing is the ability to do something like FORM.RUNMODAL(0,Customer); Just instead of having it the table CUSTOMER, I need to have it a RecordRef to that Table, without creating a variable. Maby FORM.RUNMODAL(0,RecordRef.NAME); I tried this along with many variations, and nothing seems to work. Any ideas of how to acomplish this?Elmar Freyr Vidisson
Navision Attain Certified Programmer0 -
Nope!
Well not yet that is, how knows what the future will bring
Really, this is a big problem. I made lot of really nice applications based on recordrefs. But I always have to make a codeunit or a function to show a form per record....
You have to do something like this:CASE RecordRef.NUMBER OF DATABASE::Customer : BEGIN Cust.SETTABLE(RecordRef); FORM.RUNMODAL(0,Cust); END; ESLE ERROR('No form defined'); // Should be a text constant END;
* Code have'nt been tested!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Not sure about the older versions, but in NAV 2009 R2 this can be done with the use of Variant datatype:
rRef: RecordRef; var: Variant; rRef.OPEN(18); //Customer var := rRef; FORM.RUNMODAL(0,var);
The only problem is that you can not apply filters to the record, because they get lost when you assign RecRef to the Variant variable. First record in the filter DOES get selected though. Example below:rRef.OPEN(18); //Customer rRef.FILTERGROUP(5); fRef := rRef.FIELD(2); //Customer.Name fRef.SETFILTER('T*'); rRef.FILTERGROUP(0); rRef.FINDSET; var := rRef; FORM.RUNMODAL(0,var); //Form shows all records but is focused on the first that fits in the filter 'T*'.
I hope that helps someone else too.0 -
Matjaz Sega wrote:Not sure about the older versions, but in NAV 2009 R2 this can be done with the use of Variant datatype:
rRef: RecordRef; var: Variant; rRef.OPEN(18); //Customer var := rRef; FORM.RUNMODAL(0,var);
The only problem is that you can not apply filters to the record, because they get lost when you assign RecRef to the Variant variable. First record in the filter DOES get selected though. Example below:rRef.OPEN(18); //Customer rRef.FILTERGROUP(5); fRef := rRef.FIELD(2); //Customer.Name fRef.SETFILTER('T*'); rRef.FILTERGROUP(0); rRef.FINDSET; var := rRef; FORM.RUNMODAL(0,var); //Form shows all records but is focused on the first that fits in the filter 'T*'.
I hope that helps someone else too.
Nice trick,
But how to get the selected value back?0 -
Hm, yes, I'm sorry, the original problem here is different than the one I had - I only needed to open the form, not to actually make lookup.
I have researched a bit further but haven't been able to retrieve the selected value back. I guess that you still need the record variable to make a lookup...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 320 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