SalesLogix basics – Easy Data access in SalesLogix LAN

In this basics article, I wanted to outline the use of include scripts within the SalesLogix LAN client.  Specifically, I’m going to look at the standard SLX Database Support script.

Adding an Include script to either a VB Script or a Form is easy.  On toolbar at the top of the script (or script page for the view), there is a button titled “Include Script”.  Clicking this button will open the Included scripts panel to the left of the code window.  Click the plus sign and select the Script to include. (There are a number of standard scripts available under the ‘System’ family, beginning with ‘SLX’.  These hold much of the Standard functionality provided by SalesLogix.)

There are a few simple functions you can use right away.  For example, to find a single value from a table, you can use the GetField Function:

Dim sValue

sValue = GetField(“ACCOUNT”, “ACCOUNT”, “ACCOUNTID = ‘{valid accountid}’)

I’ve written some other articles about using ADO in SalesLogix and have handled creating connections myself, however these functions are already contained within the class defined in the Database Support script.

After adding the SLX Database Support to your script as an include script:

First, you have in instantiate the Class

Dim objSLXDB = new SLX_DB

Now that you have a DB object, you can reuse the object throughout your script.

For Example, if you need a new recordset:

Set objRS = objSLXDB.Recordset

objRS.Open “SQL”, objSLXDB.Connection

As you can see, not only did I use my SLX Database object to create my new recordset, I also retrieved a connection through the object.

There’s also an ExecuteSQL function which is handy to 

objSLXDB.ExecuteSQL “Update {tablename}…”

As you can see, the Database Support script can be very handy for performing simple tasks.  Other SLX scripts include Error Support and Debug support along with a lot of other useful functionality.  You can also create your own scripts to add your own functionality.  Creating your own include script is a great way to encapsulate your custom functionality.  I’ll cover class building in a future article, so please keep reading!

Thanks!

Jason

 

 

ABOUT THE AUTHOR

Jason Buss

Jason is a senior application developer with Customer FX.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!