Tip #25 - Update Header Page from the Line Page

Yes! It is possible!

This has always been a difficult trick, even in the good old classic client where youl'd use the dirty timer to do this, but in the RTC it is much, much easier.

So what do I mean... and why am I so entousiastic.

Let's say you have added the total document amount as a flowfield to the purchase header...

And when you change the lines you want it to update but it doesn't right...

So let's make it happen. It's really easy.

Go to the subpage (Purchase Order Subform, 54) and create a new function UpdateThePage.

And key in this code with the proper automation variable...

Yes, I see you smile. Big Smile Remember this blog?

So let's call this function after we entered the Unit Cost.

The reason for two F5's is that it does not update the main page on the first, only the fact boxes.

Be carefull with this hack since all flowfields are recalculated and there will be trafic to the SQL Box.

Enjoy...

 

Comment List
  • Hi, hope you have a bright idea for this one. I have a problem which is a variant of the above. I have two line part-pages in a page. The second part shows further detail pertaining to the first and is 1 line (in part 1) to many (in part 2).

    In classic, the OnAfterGetCurrRecord trigger allowed me to write code that refreshed the second sub-form with the related details. However, in RTC, the OnAfterGetRecord trigger fires when records are displayed, not when the user focusses on a line as per OnAfterGetCurrRecord. Also, there is no Timer in the main page.

    I cannot think of a way to refresh the second part except by asking the user to tick a meaningless box in order to fire some code.

    I've also thought of completely reinventing the page to make the first part into the main page, with the former header as variables and the former part 2 as the new part 1. I'm pretty sure that would deliver the result but would mean a lot of dev time and probably look less than great.

    i'd be grateful for any guidance, johnm@tesl.com. Thanks in advance

  • You are right, I smile. This is again a great tip.

  • Got it. Thanks that was a neat tip.

  • Which is the proper Automation variable for NAV 2009?

  • You Rock Buddy...You saved my ass... :P

  • Very nice :)

Related
Recommended