Page - Timer

Rob_HansenRob_Hansen Member Posts: 296
edited 2010-10-29 in NAV Three Tier
Has anyone developed a timer add-in for pages that works without issues? I've tried the one posted on freddy's blog, and pages I use it on run fine if I run them directly from object designer, but when I set up a link to the page from either the Departments menusuite or a role center page, the RTC client crashes completely.

Comments

  • Rob_HansenRob_Hansen Member Posts: 296
    I was hoping someone would jump in quickly on this one. It's a pretty basic requirement since it's still the only way that I know of to update/refresh field values in a parent page upon changes in a child page (subform or factbox). Let me know if anyone can suggest anything here...
  • daborgdaborg Member Posts: 54
    G'day Mr. Hansen :)

    I had a lot of luck in the Classic client using the XML approach mentioned in the post below. It does not require the usage of a timer or a single instance codeunit and the update happens pretty much instantaneous

    viewtopic.php?f=23&t=22564&start=0

    I've not tried this yet in RTC but it should work??? The only thing that might be different is that you want to spawn a LOCAL instance of ther automation object, and not one on the service tier. Don't recall the syntax now but I believe to do this there is a second paramter to the .CREATE command used to create the automation object instance.

    Good luck :)
  • Rob_HansenRob_Hansen Member Posts: 296
    I didn't think WithEvents for automation objects was supported in the RTC / pages. Did SP1 add back that capability?
  • daborgdaborg Member Posts: 54
    rdhansen wrote:
    I didn't think WithEvents for automation objects was supported in the RTC / pages. Did SP1 add back that capability?

    That's a good question......I completely skipped 2009 and went right to SP1 for uhhhh....obvious reasons..... :P As far as I know it is supported but as I said.....I haven't actually tried it yet........it's still on my very lengthy to-do list :)
  • Rob_HansenRob_Hansen Member Posts: 296
    I just did a quick test to try this, and it doesn't look like the events trigger in the RTC. I tried creating a component both on the server side and the client side, but neither one fires the events. Grr...don't get me going on the RTC again...

    Anyone else have any suggestions or proven timer implementations to share?
  • Rob_HansenRob_Hansen Member Posts: 296
    One more try bumping this up in the forum...I can't believe no one has a solution for the classic "parent" update requirement on the RTC. The timer has other uses of course, but in this case I just need some way to trigger an update on the parent page when the user performs an action in a subpage (in a factbox).
  • Rob_HansenRob_Hansen Member Posts: 296
    Well, if I ever see you in person Mark, I officially owe you a beer. :)

    This approach works great - I hadn't thought of leveraging the page refresh function. Gotta start thinking outside of my Classic Client comfort zone. :)

    I had to add a bit more code on the parent page as I'm not updating flowfields in this case...I actually needed to recognize the change and run some code at the parent level. But, my page is using a temporary source table guaranteed to always have at least one record, so I hooked the code in OnAfterGetRecord (check if the subpage changed and run logic if so) and it's working beautifully!

    Thank you very much for posting that.
  • jreynoldsjreynolds Member Posts: 175
    You don’t have to rely on the Refresh (F5) function. You can define an action on the parent page and set the ShortCutKey property. The action can then be invoked from the sub-page using SendKeys. The code in the OnAction trigger can, of course, do any number of things including refreshing the page. Additionally, this all can be hidden from the user by making the action not visible as it can still be invoked with the keyboard shortcut. I typically use a shortcut that the user is not likely to stumble upon by accident (e.g. Shift+Ctrl+Alt+0).
Sign In or Register to comment.