ISProvider.AddEntityId

Description

This function adds an entity to the provider.

Syntax

object.AddEntityId(aSource, aIdentifier, aValue)

Part Attribute Type Description
object Required
The object always implements the ISProvider interface
aSource In, Required
string
The entity source
aIdentifier In, Required
string
The entity identifier
aValue In, Required
string
The entity value

Return Value

ISEntityID

Returns the added entity.

Example

Add two entities with the identifier "My identifier3" to the provider. Get the entities with the specified identifier and display their count.

Dim aFilter 
Dim aProviders
Dim aProvider
Dim aTr
Dim aEntityCollection
Dim aMessage

Set aFilter = Profile.CreateProvidersFilter
aFilter.Category = 2 'pcProvider  

set aTr = Profile.StartMapTransaction
set aProviders = Profile.LoadProvidersByFilter(aFilter)
for each aProvider in aProviders
  aProvider.AddEntityId "My source  1", "My identifier3", "My value A"
  aProvider.AddEntityId "My source  2", "My identifier3", "My value B"
  aProvider.Save
next  
aTr.Commit

set aTr = Profile.StartMapTransaction 
set aProviders = Profile.LoadProvidersByFilter(aFilter) 
for each aProvider in aProviders
  set aEntityCollection = aProvider.GetEntityIdByIdentifier ("My identifier3")
  aMessage = aMessage & vbNewLine & aProvider.FullName &_
    " has " & aEntityCollection.Count & " linked entities "
next 
 
aMessage = _
  "The number of the providers is " & aProviders.Count & vbNewLine & aMessage   
 
Profile.MsgBox (aMessage) 
Note:

In Profile Client v8 on User Interface Entity Identifier can be found in Organisation > People&Places > People and Places > Open the selected Provider > Registry > Identifier.

Version information

Added in v7.8.0