TECHNICAL NOTE 0198: Accessing File

TECHNICAL NOTE 0198: Accessing File Attachments through Siebel VB
and Siebel BusObject Interfaces
Last Modified:
12 August 1998
Area(s):
Configuration - General
Application(s):
Siebel Sales Enterprise, Siebel Service Enterprise
Release(s):
Version 4
Latest release tested
against:
Version 4
Background
In Siebel eBusiness applications version 4.0, external files accessed by Siebel applications are
stored in the Siebel file system. These files are compressed and stored using a specialized naming
convention. Connected users have direct access to the Siebel file system. Mobile users have a
local file system in the Siebel client installation. Copies of files retrieved from the Siebel file
system during synchronization are stored in the local system for access while the client is offline.
These files are accessible and readable by the Siebel Client.
Files in the Siebel file system can also be manipulated programmatically using three invokable
methods. This note documents the syntax and usage of these methods.
The supported methods are:
• CreateFile
• GetFile
• PutFile
These methods are available for all business components whose Class = CSSBCFile. The
methods can be accessed from Siebel Visual Basic (SVB), Siebel Object Linked Embedding
(OLE) Data Server, and Siebel OLE Application Server.
Note: InvokeMethod is currently supported only for the File Attachment methods listed above
and the following methods for Call Scripting – RunCallScript, CallScriptFinish, and
CallScriptCancel.
Summary
Creating a File in the Siebel File System
To create a file in the Siebel file system from an external source, use the invokable method
CreateFile. Before calling CreateFile, make sure that a new business component record has been
created. Use the ‘NewRecord" method for the business component to do this.
CreateFile
CreateFile srcFilePath, keyFieldName, keepLink > RetValue
CreateFile has the following arguments:
• SrcFilePath. This is the fully qualified path of the file being used as the source.
•
KeyFieldName. This is the name of the field in the business component that
contains the File Name. Exaple: AccntFileName field in the Account Attachment
business component.
• KeepLink. (Applies to URLs). "Y" or "N" depending on whether a link to the
file is stored as an attachment instead of the actual file.
CreateFile has the following return value:
• RetValue. "Success" or "Error" depending on whether or not the operation
succeeded.
Example from Siebel VB:
Dim RetValue as String
Dim fileBC as BusComp
RetValue = fileBC.InvokeMethod ("CreateFile", "c:\Demo\Image.bmp",
"AccntFileName", "Y")
Example using BusObject Interfaces:
Dim errCode as Integer
Dim Args(2) as String
Dim RetValue as String
Dim fileBC as BusComp
Args(0) = "C:\Demo\Image.bmp"
Args(1) = "AccntFileName"
Args(2) = "Y"
RetValue = fileBC.InvokeMethod ("CreateFile", Args, errCode)
Getting a file from the Siebel File System
To get a file from the Siebel file system to the client machine, use the invokable method GetFile.
GetFile
GetFile keyFieldName > RetValue
GetFile has the following argument:
• KeyFieldName. This is the name of the field in the business component that
contains the file name. Example: AccntFileName field in the Account
Attachment business component.
GetFile has the following return value:
• RetValue. "Success, <outFilePath>" if the operation succeeded. OutFilePath is
the fully qualified path of the file on the Client machine in the user’s temp
directory. The return value is "Error" if the operation failed.
Example from Siebel VB:
Dim RetValue as String
Dim fileBC as BusComp
RetValue = fileBC.InvokeMethod ("GetFile", "AccntFileName")
Example using BusObject Interfaces:
Dim errCode as Integer
Dim Args as String
Dim RetValue as String
Dim fileBC as BusComp
Args = "AccntFileName"
RetValue = fileBC.InvokeMethod ("GetFile", Args, errCode)
Updating a file in the Siebel File System
To update a file in the Siebel file system with the version on the Siebel Client machine, use the
invokable method PutFile.
PutFile
PutFile srcFilePath, keyFieldName -> RetValue
PutFile has the following arguments:
• SrcFilePath. This is the fully qualified path of the file on the Siebel Client
machine.
• KeyFieldName. This is the name of the field in the business component that
contains the file name. Example: AccntFileName field in the Account
Attachment business component.
PutFile has the following return value:
• RetValue. "Success" or "Error" depending on whether or not the operation
succeeded.
Example from Siebel VB:
Dim RetValue as String
Dim fileBC as BusComp
RetValue = fileBC.InvokeMethod "PutFile", "c:\Demo\Image.bmp",
"AccntFileName"
Example using BusObject Interfaces:
Dim errCode as Integer
Dim Args(1) as String
Dim RetValue as String
Dim fileBC as BusComp
Args(0) = "C:\Demo\Image.bmp"
Args(1) = "AccntFileName"
RetValue = fileBC.InvokeMethod ("PutFile", Args, errCode)