11/25/2024 11:39:38 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss using the SalesLogix COM interfaces from external applications, such as SlxApplication, ClientObjix, etc. View the code of conduct for posting guidelines.
|
|
|
|
Using the ClientOBjix to manipulate current account. SLX 6.1
Posted: 02 Apr 06 4:40 AM
|
Hello, I am trying to use the clientobjix to change the active account in SLX. I have messed around with DoBasic and DoInvoke with no success. I'm have only been able to find limited documentation on either subject (developer reference).
Any help would be appreciated.
Thanks, Jason
|
|
|
|
Re: Using the ClientOBjix to manipulate current account. SLX 6.1
Posted: 02 Apr 06 9:55 PM
|
fiogf49gjkf0d I found a solution! I don't know if this is the most optimal way of accomplishing this but it did the trick. I thought I would share what I came up with in case someone else ever needed to do the same.
First I created a VB Script (ActiveScript) in the architect that just has the following
option explicit sub main Application.BasicFunctions.SetCurrentAccountID Application.GlobalInfo("LookupAccountID") end sub
Then I used the following code in VB (we have an auto dialer application) to give the functionality of auto changing an account.
dim COB as Object 'variable for SalesLogix Client Object
set COB = CreateObject("SalesLogix.ClientOBjix")
COB.GlobalInfoSet "LookupAccountID", txtAccountNumber.Text 'set a global varialbe in slx to the account number i'm searching for COB.DoInvoke "ActiveScript", "System:LookupByAccountID"
set COB = NOTHING
I also modified the code a little and used it in Excel VB and it worked pretty slick as well.
This seems to work very well I notice sometimes the call will bring the SLX client to focus and others it will not. If anyone has a better way this could be done I would be interested to see your thoughts.
P.S. I didn't copy and paste my code so there might be typos etc...
Thanks, Jason
|
|
|
|
Re: Using the ClientOBjix to manipulate current account. SLX 6.1
Posted: 03 Apr 06 1:21 AM
|
Invoking the script is not a bad route to take, however, when I use COM for SLX I try to not rely on internal scripts. It might just be from the perspective of a BP wanting the app to stand on it's own, who knows.
Anyway, to accomplish what you're attempting you can do it without the need for an internal script. You can inject basic code easily into SLX and have it run the code just as if it were in a script plugin.
Here's a sample:
Sub SetCurrentAccount(ByVal AccountID As String) Dim slx As Object
Set slx = CreateObject("SalesLogix.ClientObjix")
slx.DoBasic ("Sub Main" & vbCrLf & _ "SetCurrentAccountID " & Chr(34) & AccountID & Chr(34) & vbCrLf & _ "End Sub")
Set slx = Nothing End Sub
Also, keep in mind that anything that executes via ClientObjix does so in the context of a legacy basic script. So anything that is something specific to VBScript, such as Application.Anything is inaccessible. I can't remember off top of my head which version this came in, might have been 6.1, but the application object itself is accessible and the prefered method for COM (instead of using ClientObjix).
ie:
Dim slx As Object
Set slx = CreateObject("SalesLogix.SlxApplication") slx.BasicFunctions.SetCurrentAccountID txtMyID.Text Set slx = Nothing
(Beware, any code samples are untested - and I am a bit rusty on VB6 style syntax )
But the ClientObjix way will also get the job done, although it's really only there for legacy/backwards compatibility purposes.
-Ryan |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|