Transferring data from 1 subform to another.
Roelof
Member Posts: 377
HI all,
I have a problem what I would like to fix.
I have created a Service Order with 2 subforms: 1 subform is for the Service Item Lines, the second one is for the Service Invoice Lines. Basically for each Service Item Line you have multiple Service Invoice Lines and both Service Item Linesand Service Invoice Linesare attached to the Service Header. I would like to have a connection between subform 1 and subform 2 so that the Service Invoice Lines are attached to the Service Item Lines, as a 1 to many relationship. It is very hard to transfer variables from 1 subform to another subform. I tried to bring both subforms in a new form as a header with a subform (header = Service Item Line and subform = Service Invoice Line) but when I attach this form to the Service Order form as a subform I get an error which says: 'You cannot call a subform from a subform'. So that doesnt work. Is there a way to fix this problem: to transfer variables from 1 subform to another subform.
Please advise.
Thanks.
Roelof.
I have a problem what I would like to fix.
I have created a Service Order with 2 subforms: 1 subform is for the Service Item Lines, the second one is for the Service Invoice Lines. Basically for each Service Item Line you have multiple Service Invoice Lines and both Service Item Linesand Service Invoice Linesare attached to the Service Header. I would like to have a connection between subform 1 and subform 2 so that the Service Invoice Lines are attached to the Service Item Lines, as a 1 to many relationship. It is very hard to transfer variables from 1 subform to another subform. I tried to bring both subforms in a new form as a header with a subform (header = Service Item Line and subform = Service Invoice Line) but when I attach this form to the Service Order form as a subform I get an error which says: 'You cannot call a subform from a subform'. So that doesnt work. Is there a way to fix this problem: to transfer variables from 1 subform to another subform.
Please advise.
Thanks.
Roelof.
Roelof de Jonghttp://www.wye.com
0
Comments
-
It's not the best solution, but you can create a flowfilter and a flowfield in the header table. Then you create a function in subform 1 to populate the flowfilter (ex: get line number). Call the function in activate and deactivate events of subform 1 (dont forget UPDATE). The flowfield makes a lookup to the lines table (document number and line number) and gets the code you want. Filter the subform 2 with the flowfield. This will only work when you activate or deactivate subform 1.Andre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
It might partly solve my problem. But I also need to have it activated when I change Service Orders or lines on the Service Item Line subform. Your solution would only work if I click on subform 2, to activate it.
Any ideas?Roelof de Jonghttp://www.wye.com0 -
You can use a timer to get the subform line No.Andre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
-
I have a new problem on this issue.
What happens is that, if I add this code and I run the form, I got an error if I go to a next Header record or create a new Header record. For some reason all filter settings are still there. Which trigger can I use JUST before creating a new record, because the 'OnNewRecord' trigger on the form itself doesn't work.
By the way, the error says:
The Service Item Line does not exist:
Identification fields and values:
Document Type = 'Order', Document No. = '1234', Line No = 4000.
The Header filtersettings are correct(doctype and docno). Line No fltersetting is coming from the previous record and I would like to have that reset.
Every idea or suggestion is welcome.
Please help.
Thanks,
Roelof de Jong.Roelof de Jonghttp://www.wye.com0 -
PS: See the website shortcut of Savatage for the Navision code solution. I used that for solving my first problem. But now I have that filter thing problem.Roelof de Jonghttp://www.wye.com0
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
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 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