Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Sendkeys F5 using Automation vs Dotnet

Posted on by 5,124

Hello Experts,

I am trying to use the Sendkeys F5 methodology when updating a calculated field in the Parent Page when a line from Child List Part is updated.  I am hoping to use the dotnet (systemwidnwosformssendkeys dotnet system.windows.forms) as it doesn't seem to pop up the automation dialog.  See below:

SystemWindowsFormsSendKeys DotNet 'System.Windows.Forms, Version=2.0.0.0,  Culture=neutral,PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.SendKeys

//Update a page

SystemWindowsFormsSendKeys.SendWait('{F5}');

SystemWindowsFormsSendKeys.SendWait('{F5}');

But this doesn't seem to work.  I don't see the calc fields from Parent page updating.

However, if I use automation (see below), it works.  But I hate that the automation dialog always pops up even though only initially.


IF ISCLEAR(wshShell) THEN
  CREATE(wshShell,FALSE,TRUE);

wshShell.SendKeys('{F5}');
wshShell.SendKeys('{F5}');

Can you advise why the dotnet technique doesn't seem to work?

*This post is locked for comments

  • mbr Profile Picture
    mbr 5,124 on at
    RE: Sendkeys F5 using Automation vs Dotnet

    I have set the runonclient to true.  But I will try the Send.  That must be it! Thank you Jonathan.

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Sendkeys F5 using Automation vs Dotnet

    Hey,

    I believe and as other members said Enabling Run on Client Property will solve your case. 

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Sendkeys F5 using Automation vs Dotnet

    set dotnet variable's property runonclient to true.

    use Send instead of SendWait.

  • Suggested answer
    Rajasekhar@MS Profile Picture
    Rajasekhar@MS 5,567 on at
    RE: Sendkeys F5 using Automation vs Dotnet

    Hi

    Have you set the "RunonClient" Property of the Dotnet Variable to YES?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans