Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Sendkeys on NAV 2013 R2

Posted on by Microsoft Employee

We are using a SendKeys for a Tree.

We are not sure about the problema we get; some keys working but we need to Expand the Tree as a default when page open.

The Page is a ListPart,  and the Tree has 3 levels.

We are using this simple code (below), but we already tried to check which is really the Expand and we cannot find a solution for this: Open the Master Page, which cal a trigger to populate the records in the ListPart as a Tree, ans we need the Expand as default, ie open all the Tree as default.

OnOpenPage()
KWGenSetup.GET;
KWGenSetup.CALCFIELDS(KWGenSetup."Enology Report Image");
KWGenSetup.CALCFIELDS(KWGenSetup."Enology Document Image");

ViewType:=TRUE;
FilterSel:=FALSE;
WhatTransferTo:=1;

GetEntriesData(FALSE,WhatTransferTo);

     // SendKeys
IF (ISCLEAR(WshShell)) THEN
  CREATE(WshShell,TRUE,TRUE);
WshShell.SendKeys('+{F2}E{ENTER}');
CLEAR(WshShell);

Tks in advance for any help from you.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sendkeys on NAV 2013 R2

    Hi, good morning,

    Not only that. What we want to do is to have the ExpandAll for a Tree in Page.

    But we want to use this kind of code in other needs, one of them is an automatically change for Fact Box view depending of user profile.

    More critical is to have ExpandAll by default in the tree.

    We just put also '^+M' ,just like we saw somewhere in the net, but we don't see any change.

    Tks Mohana.

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Sendkeys on NAV 2013 R2

    What do you want to send with these keys?

    WshShell.SendKeys('+{F2}E{ENTER}');

    Is it Shift+F2 and E and Enter?

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