ISExternalProvider.SetPhotoId

Description

This function sets the photo ID to the external provider.

Syntax

object.SetPhotoId aValue

Part Attribute Type Description
object Required
The object always implements the ISExternalProvider interface
aValue In, Required
object
The photo ID to set

Example

Set the photo ID to the external provider.

Dim aExtProvider
Dim aImageStream
Dim aHTML 
Dim aExtProviderPhotoId

aCode = "L4240"

set aTrans = Profile.StartMapTransaction 

Set aExtProvider = Profile.LoadExternalProvider(aCode)
set aImageStream = Profile.MakeStream
aImageStream.LoadFromFile("d:\Pictures for Import\PictureForProvider.jpg")
aExtProvider.SetPhotoId(aImageStream)
aExtProvider.Save

aTrans.SnapShot

aHTML = "<HTML><HEAD><TITLE>Profile Providers</TITLE></HEAD><BODY>" &_
  "<H1>" & aExtProvider.FullName & " (" & aExtProvider.Code & ")</H1>"

set aExtProviderPhotoId = aExtProvider.GetPhotoId
if aExtProviderPhotoId is nothing then 
  aHTML = aHTML & "<p><i>No photo</i></p>" 
else
  aHTML = aHTML & "<p><img src='data:image/jpeg;base64, " & aExtProviderPhotoId.AsBase64 & "'/></p>"
end if 
 
aHTML = aHTML & "</BODY></HTML>" 

Profile.ShowHTML aHTML, "Profile Provider"  
Note:

In Profile Client v8 on User Interface Photo ID can be found and set in Organisation > External Providers > Basic > Personal > Photo ID.

Version information

Added in v7.11.0
parameter aValue added in v7.11.0
parameter aPhotoId removed in v7.11.0