SP_Login

Creates the connection to SharePoint library by using the user ID, password, optional SharePoint domain.

Syntax

bool SP_Login(StrParam)

Parameters

A string containing 3 comma separated input parameters.
  1. SharePoint userID.
  2. Password.
  3. An optional SharePoint domain. If not included, do not include the preceding comma.

Smart Parameters are supported. Use smart parameters to prevent clear text passwords in your application by obtaining the password from the application service.

Returns

True if the login succeeded. Otherwise, False.
Note: If the login parameters are invalid, a failure may not occur until you call SP_Upload.

Level

All.

Details

Login to SharePoint with credentials other than the logged-in Windows User.
Example
SP_SetUrl("http://blue/Docs/Documents/+@BatchID+/+@ID")
SP_Login("userID,password,domain")
SP_SetContentType("Invoice")
SP_SetFileType("jpg")
SP_SetProperty("Date,@Value")
SP_Upload()

Alternatively, you can use smart parameters to obtain information from the application service to prevent clear text passwords. Here is an example where the password is stored in a custom value called SPPassword in the application service:

SP_Login("userID,@APPVAR(values/adv/SPPassword),domain")