Update Header page from Lines page using interoperability

patrickverhoeven
Member Posts: 7
Mark Brummel already wrote an example of this issue on his blog using an automation variable :
http://dynamicsuser.net/blogs/mark_brummel/archive/2009/12/16/tip-25-update-header-page-from-the-line-page.aspx
In the example below the SendWait function of System.Windows.Forms.SendKeys DoNet variabele is used.
Create a variable:
Create a function in a codeunit and call this function from your page:
The reason for twice an 'F5' is that it does not update the main page first. First (and only) the fact boxes are updated.
As Mark also wrote: Be carefull with this hack since all flowfields are recalculated and there will be trafic to the SQL Box.
http://dynamicsuser.net/blogs/mark_brummel/archive/2009/12/16/tip-25-update-header-page-from-the-line-page.aspx
In the example below the SendWait function of System.Windows.Forms.SendKeys DoNet variabele is used.
Create a variable:
SystemWindowsFormsSendKeys DotNet 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.SendKeys
Create a function in a codeunit and call this function from your page:
UpdatePageWithF5() //Update a page SystemWindowsFormsSendKeys.SendWait('{F5}'); SystemWindowsFormsSendKeys.SendWait('{F5}');
The reason for twice an 'F5' is that it does not update the main page first. First (and only) the fact boxes are updated.
As Mark also wrote: Be carefull with this hack since all flowfields are recalculated and there will be trafic to the SQL Box.
0
Comments
-
I've tried it in sales order page . I've made function in sales order sub form and put it to OnValidate trigger of Unit Price Incl all taxes of sales order subform page. but it's not working.
It works when i minimize and maximize the form or when i push the f5 button twice.
I want that it updates the header after moving to the next field.
PLZ Help.Sharad Gupta
Navision Technical Consultant & .Net Developer0 -
Shouldn't you use RunOnClient = Yes for the DotNet?0
-
Sorry, but I've tried to use this logic with NAV 2013 and it didn't work.
(including the "run on client" option in the automation variable property)
What can be the reason for this?
\:D/
I've found the solution:
I used "send" instead of "sendwait" and it worked fine.Rallnus (Yamaha FJ1200 - '89 / 25th anniversary was great!)0 -
Hi Rallnus
,
I was trying to work in Nav 13 r2 with this code. I have tried both Send and SendWait methods. But got error for both the Methods.
UpdatePageWithF5()
//Update a page
SystemWindowsFormsSendKeys.SendWait('{F5}');
SystemWindowsFormsSendKeys.SendWait('{F5}');
Error with SendWait
Microsoft Dynamics NAV
A call to System.Windows.Forms.SendKeys.SendWait failed with this message: Access is denied
OK
Error with Send
Microsoft Dynamics NAV
A call to System.Windows.Forms.SendKeys.Send failed with this message: SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait method.
OK
I am using the application in Windows 7 -64 Bit operating system.
Is there any problem with my code? :?:
how to define RunOnClient = Yes for the DotNet?. Please guide me. Thanks [-o<0 -
RunOnClient is on the properties0
-
Hi All,
how about using web client? is there a way to update the header from lines?I'm looking for a solution but can't find one, Please share if you already did this. Thanks in advance.
Regards,Sendoh
be smart before being a clever.0 -
Hi All,
how about using web client? is there a way to update the header from lines?I'm looking for a solution but can't find one, Please share if you already did this. Thanks in advance.
Regards,
IF SalesHeader.GET("Document Type","Document No.") THEN BEGIN
SalesHeader."Total Quantity Of lines" := SalesHeader."Total Quantity Of lines" + Quantity;
SalesHeader.MODIFY;
COMMIT;
END;
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