back to top

Using the Browse for Folder Dialog in SalesLogix

There are a few ways to use the “Browse for Folder” dialog in SalesLogix to allow users to select a directory path. First of all, there is the LookupEdit control. The LookupEdit control has a property called LookupMode. Setting this property to lmDirectory will cause the Browse for Folder dialog to appear when the user clicks the Lookup button. One problem with this approach, however. The lmDirectory LookupMode was broken for many previous verions of SalesLogix. I’m not sure of the exact version this was fixed in, but I can tell you that it was still broken in version 6.2 IIRC, it is working in 7.2 – you’ll have to check if you’re on a version in between 😉

If this isn’t working for you, or you’d like a bit more control over the dialog, you can easily invoke it in VBScript using the Shell object. The Shell object has a built in BrowseForFolder method that you can use to invoke the dialog, and set values on it for the caption, starting directory, etc.

The code is easy enough to use. Here’s a sample:

Sub btnBrowseClick(Sender)
Dim shell
Dim folder

    Set shell = CreateObject("Shell.Application")

    ' Invoke the Browse for Folder dialog and set the caption and
    ' the initial folder to the root of the C: drive
    Set folder = shell.BrowseForFolder(Form.HWND, "Select a folder...", 0, "C:")
    If Not folder Is Nothing Then
        txtDirectory.Text = folder.Self.Path
    End If
    Set shell = Nothing
End Sub

You’ll see this:

The main things to point out from this code, the BrowseForFolder method returns a Folder object. The first parameter is the HWND for the parent of the dialog. We could omit this, and leave it as 0, but then the dialog wouldn’t be modal to SalesLogix. Setting this to the HWND of the Form in SalesLogix makes the dialog modal. The second parameter is the caption for the dialog. The third and fourth parameters can make things quite interesting. The third param can be a combination of values from the ulFlags property of the BROWSEINFO struct. The forth param sets the initial directory. This can be an actual directory OR one of the ShellSpecialFolderConstants values.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Ryan Farley
Ryan Farleyhttps://customerfx.com/article/author/ryanfarley/
Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

1 COMMENT

  1. Here’s pretty much the same thing, but adapted slightly. I needed a function that could be called from any form – and therefore not dependent on the existence of a control. Function returns a path to a folder.

    This one displays the modal dialog as above, but starting at ‘My Computer’ rather than C;

    Phil

    Function SelectDir(objForm)

    Dim shell

    Dim folder

    SelectDir = "" ‘Default – no folder selected

    Set shell = CreateObject("Shell.Application")

    ‘ Invoke the Browse for Folder dialog and set the caption and the initial folder to My Computer

    Set folder = shell.BrowseForFolder(objForm.HWND, "Select a folder…", 0, 17)

    If Not folder Is Nothing Then

    SelectDir = folder.Self.Path

    End If

    Set shell = Nothing

    End Function

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos