PutFile Method for a Business Component
The PutFile method updates a file in the Siebel file system with a newer file. This method returns one of the following values:
-
Success. The operation succeeded.
-
Error. The operation did not succeed.
Format
BusComp.InvokeMethod("PutFile", SrcFilePath, KeyFieldName)
The following table describes the arguments for the PutFile method.
Argument | Description |
---|---|
SrcFilePath |
The fully qualified path to the file on the Siebel Server or the Siebel client. |
KeyFieldName |
The name of the field in the business component that identifies the file name. For example, AccntFileName in the Account Attachment business component. |
Usage
Usage for the PutFile method is similar to usage for the GetFile method. For more information, see Usage for the GetFile Method in GetFile Method for a Business Component.
After Siebel CRM uses the PutFile method to save a file attachment, you must make sure it calls the WriteRecord method so that the updated attachment is visible in the Siebel client. For more information, see WriteRecord Method for a Business Component.
Used With
To use this method, you can use a BusComp.InvokeMethod call with the following interfaces:
-
COM Data Control
-
COM Data Server
-
Siebel Java Data Bean
-
Mobile Web Client Automation Server
-
Server Script
Examples
The following example uses Siebel VB:
Dim RetValue as String
Dim fileBC as BusComp
'Instantiate fileBC to the appropriate attachment business component
'Query for the attachment record to be updated
RetValue = fileBC.InvokeMethod ("PutFile", "c:\Demo\Image.bmp", "AccntFileName")
fileBC.WriteRecord
The following example uses Siebel eScript:
var RetValue;
var fileBC;
// Instantiate fileBC to the appropriate attachment business component
// Query for the attachment record to be updated
RetValue = fileBC.InvokeMethod("PutFile", "c:\\Demo\\Image.bmp", "AccntFileName");
fileBC.WriteRecord();
The following example uses COM Data Control:
Dim errCode as Integer
Dim Args(1) as String
Dim RetValue as String
Dim fileBC as BusComp
'Instantiate fileBC to the appropriate attachment business component
'Query for the attachment record to be updated
Args(0) = "C:\Demo\Image.bmp"
Args(1) = "AccntFileName"
RetValue = fileBC.InvokeMethod ("PutFile", Args, errCode)
fileBC.WriteRecord