function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SweetBoxSweetBox 

Set the Session

In VBScript how can I set the SessionID on the SForceSession object?  I dont want to login rather I want to use and existing sessionID.

I require to create the object

Set binding = CreateObject("SForceOfficeToolkit.SForceSession")

binding.<Set_Session_Member_or_Property> = SessionID

Rather than

Set binding = CreateObject("SForceOfficeToolkit.SForceSession")

document.writeln("Sales Force Login")
MeSession = binding.Login("<username>", "<password>", False)

DevAngelDevAngel

Hi Sweetbox,

It is really straight forward:

binding.SessionId = SessionID

SweetBoxSweetBox

Ok that is easy but I have a type mismatch in my case.

I have a Web link in Salesforce to a html page with a vbscript.  In the Web link I specify to pass the SessionID.  From the url I parse the SessionID and attempt to assign it as you stated.  The session ID arrives as a string how do I change it to type compatiable with binding.SessionID?

SweetBoxSweetBox

I figured out my problem with the session ID.  I was checking if the sessionID was empty instead of null which gave a type fault.  Now I only need to set the url for the connection?

binding.SessionID = sessionID

binding.<property for session url> = sessionURL

SweetBoxSweetBox
Found it

binding.SetServerUrl ""

Thanks