ISMessage.SenderID

Description

ID of the message sender.

Syntax

object.SenderID

Part Attribute Type Description
object Required
The object always implements the ISMessage interface

Return Value

int

Example

Display the full name and ID of the sender.

Dim aTrans
Dim aMes
Dim aMessageRecipients
Dim aPatient
Dim aMessageId
Dim aSender

'Start transaction to create new message
Set aTrans = Profile.StartMapTransaction
Set aMes = Profile.CreateMessage
aMes.Text = aMes.AddText("Hello! Come to my birthday party!")
aMes.Subject = "Birthday party"     
set aMessageRecipients = aMes.Recipients
set aPatient = Profile.SelectPatient
if aPatient.Email <> "" then 
  aMessageRecipients.AddPatient(aPatient)
end if
if aMessageRecipients.Count = 0 then 
  Profile.MsgBox("The massage cannot be sent, because the patient has no email")
  exit sub 
end if   
aMes.Send  
  
aMessageId = aMes.ID

aTrans.Commit

'Start transaction to load message by its ID
set aTrans = Profile.StartMapTransaction
set aMes = Profile.LoadMessage(aMessageId) 

if aMes.SenderId > 0 then
  set aSender = Profile.LoadProviderById(aMes.SenderId)
  Profile.MsgBox("The Message Sender: " & aSender.FullName & " (ID: " & aSender.Id & ")")
else
  Profile.MsgBox("The Message Sender is not initialized")
end if   
Note:

In Profile Client v8 on User Interface Sender ID cannot be found, but Sender can be found in Organisation > Work Centre > Communication > Email > Outbox > Open E-Mail > From.

Version information

Added in v7.9.4