back to top

Using the Application object from external code

A question came up today in the SalesLogix BP newsgroups that I’ve been asked a few times before, so I thought it made sense to post the answer I gave here as well. I do plan on writing this up in article format at some point for slxdeveloper.com, but for now this will do.

Question: Can we use the SLX application object (ex. application.getconnection, application.debug.writeln, etc.) from code external to SLX or are there techniques to connect to the DB other than just hard code your ADO connection string or use an external UDL file?

Yes you certainly can. If I recall correctly, you could do this starting in 6.1.1 (not totally sure when it was changed, but I know for a fact in 6.2 you can do this). In pre 6.1.1 versions you could write a script in SLX that returned the value you wanted, such as this:

Sub Main
    Application.BasicFunctions.InvokeSetResult Application.ConnectionString
End Sub

And then get the value from your external code doing this (code in VB6 syntax to keep simple):

Dim slx As Object
Dim connstr As String

    Set slx = CreateObject("SalesLogix.ClientObjix")
    slx.DoInvoke "ActiveScript", "System:MyVbScriptPlugin"

    connstr = slx.InvokeResult

    Set slx = Nothing

That works in essentially any version (well, the Application.ConnectionString part obviously needs to be 6.0 or higher – but that line could be replaced with any other string or method to return connection values) since it uses only ClientObjix to connect to SLX. But, if you’re on 6.2.1 then there’s no problem just using the Application object.

One thing to be aware of is that there are two versions of the SlxApplication class. One that exposes the ConnectionString property (which is actually named SlxApplication2) that cannot be instantiated. The one that you can instatiate (SlxApplication) does not have that property. However you can get a connection object and pull the connection string from that.

Dim slx As Object
Dim cn As ADODB.Connection
Dim connstr As String

    Set slx = CreateObject("SalesLogix.SlxApplication")
    Set cn = slx.GetNewConnection

    connstr = cn.ConnectionString

    Set cn = Nothing
    Set slx = Nothing

Again, this is all done in your C#, VB, whatever code in your own application. With COM in SalesLogix, the client must be running, but it provides an easy way to get the connection details that the client is connected to and use the same in your own application. No need to prompt the user for login details or anything – and that is the way it should be if the intent of your app is to interact or enhance the client in any way.

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
Previous article
Next article
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

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