Update Forms

Seppe
Member Posts: 14
Hi all,
I have 2 different forms, form A and Form B. On each form I have a control. Form A -> "Reference Date", on Form B -> "New Date". When I open Form A, Form B opens automatically and the 2 controls are filled with the workdate.
Is it possible -and if so, how- to change the control "New Date" on Form B automatically when i give another date in the control "Reference Date" on form A, and vice versa?
Thanx in advance
I have 2 different forms, form A and Form B. On each form I have a control. Form A -> "Reference Date", on Form B -> "New Date". When I open Form A, Form B opens automatically and the 2 controls are filled with the workdate.
Is it possible -and if so, how- to change the control "New Date" on Form B automatically when i give another date in the control "Reference Date" on form A, and vice versa?
Thanx in advance
0
Comments
-
Create a function on Form B. UpdateNewDate that sets this field by a date value received in a parametern, and then just code to Form A - OnValidate or OnAfterValidate to varFormB.UpdateNewDate("Reference Date")
Do It Yourself is they key. Standard code might work - your code surely works.0 -
Thanx for answering Shenpen,
When I open form A, form B opens, both with the workdate as the default date.
But the problem is that, when I change my date in form A, he doesn't change on form B, so I put an "Update" in my function.
Then when I change my date in form A, I get a message that says : "The form is not open"
If lethere is a solution, please t me know! ](*,)0 -
Hi Seppe,
If I don't understand wrongly, the flow should be something like:
1. User open form A
2. in the form A, create an instance of form B (with and update function in it to update a global var inside form
3. use update function set global var in form B
4. open form B
Actually I am just re-iterating shenpe's answer.
Rgds,
Jon.Rgds,
Jon.0 -
Hi,
Keep in mind that that way the 'vice versa' thing doesn't work. You can update the data on Form B from the Form A (since the Form A has created an instance of Form, but there is no way to update Form A with values from Form B.
0 -
Hi Jon,
Form A and form B open on the same time. After opening these forms, I want to change a variable on form A, and I want the variable on form B takes over these changes without closing and reopen.
Regards0 -
Seppe wrote:
Form A and form B open on the same time.
What do you mean by "on the same time" ? Somethink like :
FormA.RUN;
FormB.RUN;
In this case, there is no link between both forms, so, to pass informations :
- work with a table where you put the information and read it back in the Forms with a timer.
OR
- work with a "single instance" CodeUnit 1, create a variable to store the information in the CU 1 and read it from the Forms with a timer.
As you see, not so easy ...0 -
Hal,
Nothing is easy here! :whistle:
No, it's a simple FormB.RUN in the Onopen trigger of FormA.
In form A I made a variable of form B, to call the function in form B that takes over the changes in Form A. But on form B, I have to use an UPDATE function in order to see the changes. When I use the UPDATE function it gives me the message that form B is not open.
The 'vice versa' stuff is no longer necessary.
Regards0
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