Page is not refreshed

Cem_KaraerCem_Karaer Member Posts: 281
edited 2014-05-14 in NAV Three Tier
Hello,

I use a dotnet variable with events. When a call comes to a client, a page in NAV 2013 should view caller's data (data are found by using caller's phone number). Dotnet variable catches the call, finds the phone number and finds the related customer writes all those to page variables which are shown as fields, but but.. I cannot display the data as soon as the call comes, but when I manually refresh the page (pressing F5 key), all of data are shown.

I could not find anyway to achieve the behavior of pressing F5 in code. Is it possible?

Note: CurrPage.UPDATE doesn't work. The page even does not show any message (MESSAGE command)!
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005

Comments

  • vremeni4vremeni4 Member Posts: 323
    Hi,

    You have two options.
    1. Option
    You can use Send keys, as explained in this blog
    http://dynamicsuser.net/blogs/mark_brummel/archive/2009/12/16/tip-25-update-header-page-from-the-line-page.aspx

    2. Option
    You can create a time add-on as explained in this blog:
    http://blogs.msdn.com/b/freddyk/archive/2009/11/03/timer-events-on-a-page.aspx

    I hope this helps.
  • Cem_KaraerCem_Karaer Member Posts: 281
    I preferred the first option, because it seems fairly simple, but unfortunately the following error appeared:

    Microsoft Dynamics NAV

    Break On Error Message:

    This message is for C/AL programmers: The call to member SendKeys failed: Index (zero based) must be greater than or equal to zero and less than the size of the argument list..
    OK
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
  • vremeni4vremeni4 Member Posts: 323
    Hi,

    Without being able to see the code it is difficult to say what is wrong.

    Anyhow when I red the message it looks like you called SendKeys without any parameters, at least that is what the error message says.
    See this for more info
    http://www.mibuso.com/forum/viewtopic.php?f=5&t=25712

    I hope this helps.
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    The PingPong add-in was included in NAV 2013 for doing these kinds of timed callbacks.

    http://msdn.microsoft.com/en-us/library/jj551782(v=nav.71).aspx
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • Cem_KaraerCem_Karaer Member Posts: 281
    The problem persists. Automation variables cannot be used. Instead of automation I used dotnet variable with the help of following link:

    http://www.mibuso.com/forum/viewtopic.php?p=242129#p242129

    Here are the patches of the code. The event is triggered when a phone call comes to the client terminal:
    VoxtronClient70::OnContactTransfer(newContact : DotNet "VoxtronClient.ClientIntegration70_Contact_Interface")
    CallFunction(newContact.ContactFrom);
    
    SystemWindowsFormsSendKeys.SendWait('{F5}');
    SystemWindowsFormsSendKeys.SendWait('{F5}');
    

    Global Variable (WithEvents = Yes)
    Name DataType Subtype Length
    VoxtronClient70 DotNet VoxtronClient.ClientIntegration70.'VoxtronClient70, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ebf42ccfc26401bd'

    Local Variable (RunOnClient = Yes)
    Name DataType Subtype Length
    SystemWindowsFormsSendKeys DotNet System.Windows.Forms.SendKeys.'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    I got the following error:

    Microsoft Dynamics NAV

    Break On Error Message:

    Microsoft Dynamics NAV Application Server attempted to issue a client callback to create a DotNet object: System.Windows.Forms.SendKeys (CodeUnit ... ...). Client callbacks are not supported on Microsoft Dynamics NAV Application Server.
    Tamam

    Here is the question:
    Why are client callbacks not supported on Microsoft Dynamics NAV Application Server?
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
Sign In or Register to comment.