web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How can I get value of TreeView selected Node in VBA?

(0) ShareShare
ReportReport
Posted on by 45

Hi,

I am trying to get value of selected node of TreeView in VBA on Select In-Transit Items window. 

I have added TreeView control field in VBA and when I tried to get Value, It always returns empty. How can I get that selected value?

See below screenshot.

pastedimage1648137955530v2.png

Thanks,

Atul

Categories:
I have the same question (0)
  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,093 Most Valuable Professional on at

    Hi Autel

    The only method that will work from VBA is pass through sanScript and using the Dexterity commands.

    I would recommend that you move away from VBA which is "End of Life" and does not work on the web client and Windows Servers.

    Instead you should look to the alternatives, Dexterity, Visual Studio Tools or better still GP Power Tools which is a perfect replacement for VBA as well as offering many other must have features.

    See: https://winthropdc.wordpress.com/2019/08/12/gppt-replacing-vba-with-gp-power-tools-developer-tools/

    Also see the Benefits Presentation: https://www.winthropdc.com/ftp/pub/GPPowerTools_Benefits.ppsx

    David

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,093 Most Valuable Professional on at

    The following example shows how you can call Dexterity SanScript code from VBA

    winthropdc.wordpress.com/.../

    Here is some example code:

    local long node_ID;

    local string node_label;

    {Get the ID of the selected node.}

    node_ID = TreeView_GetSelectedNode('TreeView' of window WindowName of form FormName);

    if node_ID <> TV_NODEINVALID then

       {Get the node label.}

       node_label = TreeView_GetNodeLabel('TreeView' of window WindowName of form FormName, node_ID);

    else

       warning "No item is selected in the Address List field.";

    end if;

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans