Question: tablebox + drill-down

Resender
Member Posts: 119
Hello all,
I got the current situation
A form displaying a list of adress's in a tablebox, these adress's have to be viewed by the user to see if their the correct ones.The are importadress's and each is linked to a areacode.
*A field & variable #... is added to the tablebox, it has to show how many alternative adress's are available for this current one.
*On the #..., we want a drill down to lead us to a form that shows all the alternate ones.
I added the variable and the field,added dril down to the field. Created the new form,ect...
Now comes the problem, the #... shows the total amount of adress's that are around and not the amount available for the area code.
Second problem is the drill down instead of passing the records for the area code it passes them all along.
Anyone know how this must be done.
I got the current situation
A form displaying a list of adress's in a tablebox, these adress's have to be viewed by the user to see if their the correct ones.The are importadress's and each is linked to a areacode.
*A field & variable #... is added to the tablebox, it has to show how many alternative adress's are available for this current one.
*On the #..., we want a drill down to lead us to a form that shows all the alternate ones.
I added the variable and the field,added dril down to the field. Created the new form,ect...
Now comes the problem, the #... shows the total amount of adress's that are around and not the amount available for the area code.
Second problem is the drill down instead of passing the records for the area code it passes them all along.
Anyone know how this must be done.
0
Answers
-
Resender wrote:Hello all,
Second problem is the drill down instead of passing the records for the area code it passes them all along.
And after a day or 2 I found a drill down that didn't involve table relationships
(Simplified and changed names)MyRecVar.RESET; MyRecVar.SETRANGE(Key1,recFrm.Key1); CLEAR(MyFrmVar); MyFrmVar.SETTABLEVIEW(MyRecVar); MyFrmVar.RUNMODAL;
Off course that didn't do the trick 100%
So I focused my search from combining the 2 questions to 1.
'In Navision Attain 3.60, how do I get the data from the current selected record(s) in a tablebox ?'
I found the followingCurrForm.SETSELECTIONFILTER(MyRecVar);
Ok, so now I can pass the current selected record(s) along, problem now is that I don't need
that record that I selected, I need all the alternatives for that record.
However when I do a message post directly after the setselectionfilter I get an empty message.
So the second problem is solved, now back to the first, find the amount of alternatives for each record.
Ok I resolved this on my own as wellMyRecVar.RESET; MyRecVar.COPYFILTERS(Rec); MyRecVar.SETRANGE(Adrescode,Rec.Adrescode); MyRecVar.SETFILTER("Primary key",'<>%1',Rec."Primary key"); MyFrmVar.SETTABLEVIEW(MyRecVar); MyFrmVar.RUNMODAL();
This allows le to show all the alternatives for an adress excluding the one already selected.
And a thirth problem occured but that I can resolve with the guy who made the existing code.
I also resolved the first problem I hadResender wrote:Now comes the problem, the #... shows the total amount of adress's that are around and not the amount available for the area code.
Solved this as well, by looking to the individual problem and not to the whole
First I found an excellent post here on Mibuso about the Difference Between OnAfterGetRecord & OnAfterGetCurrRecord
So I did the following in the OnAfterGetRecord of my formiAantal := 0; lrecConv.RESET; localRecVar.COPYFILTERS(Rec); localRecVarSETRANGE(Adrescode,Rec.Adrescode); IF localRecVar.FIND('-') THEN BEGIN REPEAT iAantal := iAantal +1; UNTIL localRecVar.NEXT = 0; END;
I then ran this and looked if into the table if this was indeed showing the correct number for each adrescode.
Ok, so how come I have now found everything on my own, well:
1)I had a weekend with no worries so fresh prospective
2)Found code simelar to what I was needing in existing form
3)I looked to the individula parts instead of the whole0
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