Difference between revisions of "API Code: Upload File to Custom Field"

From SmartWiki
Jump to: navigation, search
Line 16: Line 16:
  
 
This [[API]] may not work for files larger than 64MB in size.
 
This [[API]] may not work for files larger than 64MB in size.
 +
 +
==See Also==
 +
* [[API Sample Code]]
  
 
[[Category:Integration]]
 
[[Category:Integration]]

Revision as of 10:32, 15 July 2009

The following is an sample of code that would upload a file to a specified field using the API:

Dim tk As New SmartComClient.Toolkit
Dim CurrentSession As SmartComClient.Session
Dim rtn As String
Set CurrentSession = tk.LoginUser("alias", "alias.smartsimple.com", "myname@mydomain.com", "mypassword")
If CurrentSession Is Nothing Then
       MsgBox tk.getLastErr()
Else
       rtn = tk.uploadFileField(CurrentSession, 12345, 98765, "d:\temp\sample.pdf")
       MsgBox rtn
End If

Note: 12345 is the target custom field ID and 98765 is the Object ID (opportunityid, activityid, userid, companyid, etc.)


This API may not work for files larger than 64MB in size.

See Also