How Do I Run a VBScript OUTSIDE of SalesLogix?

VBScripts CAN be run completely outside of SalesLogix. BUT you do not have access to the SalesLogix Application object.

First you need to be able to make a connection to the (SalesLogix) Provider. The key part here is to pass in a valid (SalesLogix Provider) connection string. I usually create a “.udl” file to do all the heavy lifting here. This is what the contents of a typical “.udl” looks like:

 [oledb]
; Everything after this line is an OLE DB initstring
Provider=SLXOLEDB.1;Password=mypassword;Persist Security Info=True;User ID=admin;Initial Catalog=SALESLOGIXV754DEV;Data Source=GOBIDEV;Extended Properties="PORT=1706;LOG=ON;CASEINSENSITIVEFIND=ON;AUTOINCBATCHSIZE=1;SVRCERT=;"

Now we need to concentrate on the actual script itself. For this example we assume the “.udl” file is called MyConnection.udl and is located at the root of “C” (C:\MyConnection.udl) :

 
Sub Main
  Dim objCon  'SalesLogix Connection Object
  Dim sConnString
  Dim strSQL00
  Dim objMyRS
  Dim blnNewSlxConnection

  'Get a connection to SalesLogix - Cannot use the Application Object in an Agent or outside of SalesLogix
  ' We have to do all of this "outside"
  sConnString= "File Name=C:\MyConnection.udl"

  'Now connect up
  Set objCon = CreateObject("ADODB.Connection")
  If Err.Number <> 0 Then
    blnNewSlxConnection= False
    If IsObject(objCon) Then
      Set objCon = Nothing
    End If
    Err.Clear
    Exit Sub
  Else
    blnNewSlxConnection= True
    objCon.ConnectionString = sConnString
    objCon.Open
  End If

  'Do some work - get data from USERINFO table
  strSQL00 = "SELECT * FROM sysdba.USERINFO"
  Set objMyRs = CreateObject("ADODB.Recordset")
  With objMyRS
    .CursorType = adOpenStatic
    .CursorLocation = adUseClient
    .LockType = adLockBatchOptimistic
    .Open strSQL00, objCon
  End With
  'Now pull in data from USERINFO... and do something with it
  If Not (objMyRS.EOF Or objMyRS.BOF) Then
    'OK
    With objMyRS
      If .RecordCount > 0 Then
        'We have data - now do work...
        While NOT (.EOF or .BOF)
          strUserID = .Fields("USERID").Value
          strLastName = .Fields("LASTNAME").Value
          'Now do some work w/this data
          Call WriteResultsToTraceFile(strUserID,strLastName)
          .MoveNext
        Wend
     Else
       'No data found...
     End If
  End With
  'All done..close shop
  If IsObject(objMyRS) Then
    objMyRS.Close
  End If
  Set objMyRS = Nothing
  If IsObject(objCon) Then
    objCon.Close
  End If
  Set objCon = Nothing

The above is a very simple framework and certainly can be expanded. I have created an include file that contains several of the key functions:

Function NewSlxConnection(ByVal sConnString, objCon)
Function CloseSlxConnection(objCon)
Function GetRecordSetObj(objCon,ByVal strSQL)
Sub CloseRecordSetObj(objRS)
Function ChkError(strInfo)
Function FixQuote(ByVal sSrcLine)
Function ExecuteSQL(objCon, ByVal sSQL00)
Function GetScalarValue(objCon, ByVal sSQL00)
Function GetMultipleScalarValue(objCon,ByVal strSQL, ByVal iRecCount, strValue)
Function GetMultipleValuesFromDB(objCon, ByVal strSQL, strValue)
Function CreateIdFor(objCon, ByVal sTableName)
Function CreateBlockOfIDFor(objCon,ByVal strTableName, ByVal sRecCount, strRecordID)
Function IsEmptyRecordset(ByRef objRS)
Function GetRecordCount(objCon,ByVal TableName, ByVal PKName, ByVal sWhere)

We use this include file in all our external VBScripts and for a small fee we do license it to anyone who is interested (along with some samples/examples).

, , , , ,

Leave a Comment

Is Low Tech the NEW High Tech?.. The Pencil

For those who do not know – March 30 was(is) National Pencil Day…. and stats indicate sales are UP this past year on WOOD pencils and associated accessories (sharpeners, erasers, etc.).

Remember that Number 2 yellow pencil? You first learned to write with one and probably left a few teeth marks on a few as well. ..and NO you do not have “lead poisoning” because “lead pencils” were NEVER made of lead. They were always (and still are) made of graphite.

In my early engineering days we were encouraged to keep a daily journal/notebook. Always writing down little (and large) items during our day. We did this with a (yellow) number 2 pencil. I still keep a spiral bound notebook to the right of my keyboard and jot things down (in pencil ;-) . Every morning the first thing that is typically done is to draw a horizontal line.. make note of the day and date.. and to make a time entry with something like “.. Read Email & NG’s..” When I answer the phone I also make a note. At lunch time there is a blocked out time slot noted for lunch. If you were to take a look at my (office) supply/storage closet you would see a pile of 8.5 x 11 spiral bound notebooks filled with data/notes going back YEARS.

The pencil (and paper) is where I start when designing anything. It could be a program to solve a customer’s problem, a bookshelf that I plan to build, even a remodel of a kitchen. The best part is NO BATTERIES REQUIRED.. NO POWER CORD.. all the power required is ME! PLUS it is Mobile ;-)

We tend to rely way too much on technology but I believe our best ideas come from just simply putting a Number 2 Yellow Pencil in our hand.. take a piece of paper.. and dream.

Oh yes, my favorite Yellow Number 2 is made by the largest wood pencil maker in the world – Dixon Ticonderoga – over 1.5 BILLION made every year!

, ,

Leave a Comment

Why Do In-Active Users Show Up On My Leader Lookups?

There are two forms/views in SalesLogix Windows/LAN that are Activity/History related – the Create Activity (Activity Details View form) and the Complete Activity (History Details View form). The 2nd form is also used to insert/edit the Notes-History records as well.

Normally the “Leader” lookup is populated with the name/Id of the current user and that is teh end of it. However, in normal business operations/workflow there are times when the current user is scheduling/completing, etc. an Activity (or adding a note-history record) for someone else. So you simply click on the lookup and pick that user and away you go – or do you?

It turns out there is a bit of built-in set of “rules” that govern just what you get to choose from… and here is that rule:
“You can ONLY choose a user to be an Activity User IF you have access to their calendar”
Now back to the subject of this post… “Why do in-active users show up on me Leader Lookups” .. simple.. when you retired the user you did not remove calendar access to them from other (active) users.

This short blog was inspired by one of our customers (Thank You Patti!) when she sent me an email asking just that. They have had SalesLogix for a long time and have had users come and go. Theirs is a business where just about every SalesLogix user can “see” just about all the other user calendars. More than likely none of the retired were ever removed from the Active user(s) calendars. A quick cleanup (via the admin – user profile – Calendar tab) will correct that situation.

Here is a GREAT take-away:
Oh yes, it happens that there is also a custom MainView (not implemented by us ;-) that has it’s own custom dialog for Activity scheduling. It “happens” to have a lookup that is used to pick a “leader” and the calendar clean-up did not fix it.. and why you ask?.. Well it has to do with the LookupMode property of the lookup control. The two (2) OOTB (Out Of The Box) forms using Leader (lookup) have it set to lmCalendarUser – the custom is simply lmTable. A quick edit or two (changing it to lmCalendarUser) and now the problem is solved!

,

Leave a Comment

Problem Connecting Network Clients To SLX Server

This subject seems to popping up more.. and more.. and more…. now that many are switching over to to SQL2008 (and/or 2008R2). Well, fear no more since there are some very basic simple rules you MUST follow to get hooked up correctly. If you follow these rules, the chances of all things working out are probably 100%.

If your installation is a SQL2005 you need to add/install the SQL2005 native client to ALL systems that have any SalesLogix Components (ex: Server, Synch, Web Site, individual Windows desktops running the SalesLogix Windows/LAN client). the ONLY exception are (individual) SalesLogix remote clients since the installation of SQLExpress2005 automatically installs the native client.

If your installation is a SQL2008 (SQL 10.0) (NOT R2 – which is SQL 10.1) Then you need to install BOTH the SQL2005 native client AND the SQL2008 (10.0) native client on the SalesLogix Server. The individual desktops only need the 2008 native client (10.0). Any other systems that have a SalesLogix “client app” ( ex: synch, Web Server, etc…) only need the 2008 (10.0) as well.

If you have SQL2008R2, you have SQL 10.1 and have the same requirements as SQL2008 except you install the R2 version (SQL 10.1) of the native client… as well as the SQL 2005 native client on your SalesLogix “server”.

It may sound confusing but it ends up being simple… You ALWAYS install the SQL2005 native client on your SalesLogix Server in situations where your SQL server is SQL2005/2008/2008R2. You also install ONLY the appropriate SQL native client on ALL systems that have a SalesLogix “client app”. When in doubt.. install both the 2005 and the appropriate 2008/1008R2 native client. It does not hurt.

NOTE: We have also seen several situations where people get confused over the correct driver for SQL2008R2. Always install the 10.1 version in these situations.. NOT the SQL2008 10.0!

, , ,

Leave a Comment

Apple is sitting on 98 BILLION Dollars in “Cash”…

… and does NOT know what to do with it! I have a “few” suggestions…. it starts with give me some ;-) ..

Considering the state of the economy, jobs, etc.. why doesn’t Apple spend some of it building a new state-of-the-art high tech factory right here in the USA to build iPhones and iPads? Think of it.. be able to purchase an iPhone/iPad designed/developed/built in the USA! Also think of the associated jobs that would be created to build/staff/maintain the facility. Add in the logistical related jobs from small and medium sizes business as well.

What does Apple do about the factory in China? Use it to continue to build the devices but NONE of them would be shipped to North/South America or Europe. The USA factory would provide ALL the devices for North/South America and Europe.. China the rest of the world.

Quick update (3/18/2012).. I see that Apple plans to spend $10B on a stock buy-back… not smart… APPLE.. take my idea and CREATE JOBS!

, ,

Leave a Comment

New iPad… Is it Really New Or Is It Just a Re-Hash?

It is rather interesting that #Apple choose to NOT give the new #iPad a name.. other than “iPad”. Could it be that there is really not a lot there?

Basically, this is what is new:
A – Super resolution Screen.. the highest resolution available and even better than typical PC’s.
B – A new processor. It NEEDs that new processor to “feed” the new screen ;-)
C – 4G access on cell nets.

There are other things but the above are the real basic new items. For consumer users, there’s nice stuff here because games are going to look a lot better. For business users.. no big deal. Your iPad 2 (and maybe even “1″) will be just fine.

Maybe the 4G is the big deal?.. and maybe not.. It turns out most people use their iPads on WI-FI! Trust me, WI-FI is faster than the 4G nets.

So, is it really new or a re-hash? Only time will tell.

The REAL BIG DEL HERE IS – iPad 2′s are going to be CHEAPER! In fact, the wi-fi version will be $399 AND it will have 16gb – not 8. SO if you REALLY want an iPad I suggest you purchase the reduced price iPad 2 and skip on the new one.

UPDATE: March 22,2012
It seems we are finding out the new iPad has a few “warts”…. High Temperature issues ( Consumer Reports tests), you “burn thru” your 4g bandwidth allotment VERY quickly (just watch “March Madness” for a couple of hours!), and now it takes (almost) forever to re-charge the battery.

, , ,

Leave a Comment

ComboFix is DANGEROUS to Sage SalesLogix and Potentially to Other Apps

We all try our best to keep systems up to date and healthy. There are TONS of tools out there which are “intended” to keep us free from malware and virus attacks. Some do.. some do not.. some cause damage – and ComboFix is one of those that causes damage.

We (as well as many other Sage SalesLogix Customers and BP’s (Business Partners)) have seen when ComboFix is run on a system that has Sage SalesLogix synchronization components/apps installed, synchronization will no longer function. Unfortunately (as of this blog post) the ONLY fix to this is a total “wipe” of the hard drive, complete OS re-install, as well as all applications. AFAIK there is NO other way to fix the problem once ComboFix has been run.

, , , , ,

Leave a Comment

Have you ever seen: “Database Login Failed: Unspecified Error” ?

There are several situations/conditions in Sage SalesLogix which will cause users to see the error:
“Database Login Failed: Unspecified Error”.

It turns out there is one interesting situation related to networking that causes this to happen with  SalesLogix Remote (Windows) users. This is when the system (laptop) has wireless turned on AND it has a hard-wired active connection at the same time.

We just had a customer where this happened. When the user was at their home office they had a wireless connection and all was well. When in the corporate office and hard-wired to the LAN, it threw up the subject error.  By simply “turning-off” the wireless when hard-wired to the LAN, the problem went away.

UPDATE: Since I first made this post, I have run into another situation which will cause the subject error. “Sometimes” the SLXSystem.exe will stop responding to system requests and need to be manually stopped via the Task Manager. It should only be running when logged into the SalesLogix Client app – except when as a service in a terminal/Citrix server setup. You can “kill it off” by going int the Process tab in Task Manager, locate it, click on End process.

, , , ,

Leave a Comment

Sage SalesLogix Mobile Web 1.2 – and why you want it NOW!

As many of you already know, I have decided to focus on three things:
1 – Mobility
2 – Mobility
3 – Mobility

Got the idea ;-)

We are definitely in the “Age Of Connected Mobility” with smart-phones and pads/tablets popping up everywhere. I would certainly like to see the stats on just how many new mobility devices will show up in Christmas stockings, etc….

So with “mobility” in mind, it’s now official, the Sage SalesLogix Mobile Web Application version 1.2 is now available! It builds on the 1.0/1.1 releases to bring us some new features:
• Improved usability features including: single-press pick lists and lookups, “Clear” button on text fields, custom keyboard for URLs, e-mail, and phone data entry, and combine hash tags with search text.
For example, Opportunity: “#closed ab” searches for closed opportunities where the name starts with “ab”.

• Calendar contains new week view and month view shows activity count and selected day
details.

• Support for French, German, Italian, Russian and English languages through a single
portal.

NOTE: In order to take advantage of “localization”, you need to make sure you are pointing at the .aspx page not the .html. Otherwise, you will ONLY see English ;-)

.. and to add – it installs in just a few (5) minutes.. and existing 1.1 customization(s) (if done using the “module” approach) should NOT break!

What I really like are the Calendar enhancements. week/month view w/activity info and counts!

 

, , ,

Leave a Comment

How Many SalesLogix Licenses Do I have and What Type Are They?

Sounds simple.. doesn’t it? Well it is and it is not.

You could go into the SalesLogix Admin application, click on the Systems icon and then the licenses tab and look. It will show you all your licenses. BUT if you have one or two of this and that you need to sort , then count, etc. to see what you have.

Here’s a SQL query that does it very quickly and cleanly:

--
--Saleslogix License types and counts
--
SELECT TYPE as TypeCode, CASE TYPE 
   WHEN 'C' THEN 'Concurrent'
   WHEN 'M' THEN 'Remote'
   WHEN 'N' THEN 'Named User'
   WHEN 'P' THEN 'Template'
   WHEN 'R' THEN 'Retired'
   WHEN 'V' THEN 'Web Viewer'
   WHEN 'W' THEN 'Admin'
   ELSE 'Unknown'
   END as LicenseType,COUNT(*) As NumberOfLicenses
  FROM [sysdba].[USERSECURITY]
  group  by type
  having COUNT(*) > 0
  Order by LicenseType

The output will look something like:

TypeCode   LicenseType	NumberOfLicenses
  W          Admin         1
  C          Concurrent   55
  N          Named User   72
  M          Remote       19
  R          Retired     222
  P          Template     12
  V          Web Viewer   14

Leave a Comment

Follow

Get every new post delivered to your Inbox.

Join 67 other followers