12-08-2011 07:16 PM
Hi,
Just so confused for the VBScript used by SalesLogix LAN version. I am new to SalesLogix development. Could anyone tell me what VB version it is using? I try some basic VB syntax, it just cannot pass
For example I declare a String variable like Dim a as string, but the Syntax Check report error, if I remove "as string", then it is fine. Why it is like that?
Also can anyone give an example of function return string array? I did like this:
Function a()
Dim contactDetail(3)
contactDetail(0) = objRS.Fields("PatronID").Value
contactDetail(1) = objRS.Fields("FirstName").Value
contactDetail(2) = objRS.Fields("LastName").Value
End Function
And they call it as
Dim r()
set r = a
Then I got runtime error about the object type mismatch.
Can anyone give me any suggestion?
Thanks a lot
Solved! Go to Solution.
12-09-2011 12:57 AM
I believe it uses VB Script, so you won't be able to Dim a variable a Typed Variable, this is why you can't declare with "as string".
Second, your Function is not returning any values.
In VB, you assigned the return value to the Function name (within the function).
Function getMyArray()
Dim contactDetail(3)
contactDetail(0) = objRS.Fields("PatronID").Value & ""
contactDetail(1) = objRS.Fields("FirstName").Value & ""
contactDetail(2) = objRS.Fields("LastName").Value & ""
getMyArray = contactDetail
End Function
Last, but not least, an array is not an object, so you shouldn't use "set" with it.
This will work with the Above function:
Dim myArray
myArray = getMyArray()
As stated above, SalesLogix Windows Client uses regular VB Script, so you could use any reference material on how to program VB Script, and 99% of it will be applicable.
12-09-2011 05:36 AM
Initially VBScript 5.6.
You need to get a copy of the Microsoft VBScript help file. it's what most of us have been using since the initial release of VBScripting in SalesLogix v6.0. If you can't find it, here's a link to a copy we keep around:
www.rjlsystems.net/TheToolBoxX/VBScript/script56.chm
NOTE: You will also need a copy of the Saleslogix "LAN DEV Ref" which you can download from teh SalesLogix Support site. It has the "extensions" that the SalesLogix dev team has added to the VBScript environment.
Prior to that.. it was "Cypress Enable".
12-10-2011 05:16 PM
Prior to that.. it was "Cypress Enable".
I thought that it was "Cypress Depressed".....
12-12-2011 01:46 PM
Thanks a lot for all your help!
12-12-2011 03:12 PM - edited 12-12-2011 03:13 PM
Now if I could only figure out the difference between Java and JavaScript.....