select a line in a subform and pass values on the line

kikkoman
Member Posts: 57
hello everyone,
on the sales order form, i want to be able to select (highlight) a line in the subform, which is table Sales Order Subform and then hit a button, and then from there pass the values on the line and do something. for example, on the line, Type=item and No.=123, then when i highlight the line and hit my button, it will pass Type, No. and whatever else fields i need.
i have created a new function in my subform, with lets say in my example with 2 parameters. so when i hit the button on the main form,
CurrForm.SalesLines.FORM.mynewFunction(Type,"No.");
my new fn will run and get passed the 2 fields i need.
the problem is that the values are NOT the values on the Line but instead the value of the Sales Header record instead of the Sales Line record.
how do i select the values of the LINE and not the header?
i could just pass the header "No." field which is the primary key for table Sales Header and then filter my Sales Line table by that number, but i don't know how to tell Navision the line i want is the one selected? so therefore i won't be able to filter the sales line table b/c i don't know how to retreive the highlighted line?
it might just be a simple native function that i don't know about...or something simple, but i can't figure it out!!! ](*,)
any help is greatly appreciated..
on the sales order form, i want to be able to select (highlight) a line in the subform, which is table Sales Order Subform and then hit a button, and then from there pass the values on the line and do something. for example, on the line, Type=item and No.=123, then when i highlight the line and hit my button, it will pass Type, No. and whatever else fields i need.
i have created a new function in my subform, with lets say in my example with 2 parameters. so when i hit the button on the main form,
CurrForm.SalesLines.FORM.mynewFunction(Type,"No.");
my new fn will run and get passed the 2 fields i need.
the problem is that the values are NOT the values on the Line but instead the value of the Sales Header record instead of the Sales Line record.
how do i select the values of the LINE and not the header?
i could just pass the header "No." field which is the primary key for table Sales Header and then filter my Sales Line table by that number, but i don't know how to tell Navision the line i want is the one selected? so therefore i won't be able to filter the sales line table b/c i don't know how to retreive the highlighted line?
it might just be a simple native function that i don't know about...or something simple, but i can't figure it out!!! ](*,)
any help is greatly appreciated..
0
Comments
-
nm, i figured it out \:D/
geez...i don't even need to pass any parameters...the code
CurrForm.SalesLines.FORM.mynewFunction;
will automatically filter the line that i'm on... so if i'm on line = 40000
then when i get into my new function on the subform, the code already knows that is my filter.... DOH!!!!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