ISExternalProvider.AddEntityId

Description

This function adds an entity to the external provider.

Syntax

object.AddEntityId(aSource, aIdentifier, aValue)

Part Attribute Type Description
object Required
The object always implements the ISExternalProvider 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 external provider. Get the entities with the specified identifier and display their count.

Dim aExtProvider 
Dim aCode
Dim aEntityIdentifier
Dim aTr
Dim aEntityCollection
Dim aMessage

aCode = "1"
aEntityIdentifier = "My identifier3" 
set aTr = Profile.StartMapTransaction
Set aExtProvider = Profile.LoadExternalProvider(aCode)

if aExtProvider.ID = 0  then 
  Profile.MsgBox("No external provider with the specified code")
  exit sub   
end if

aExtProvider.AddEntityId "My source  1", aEntityIdentifier, "My value A"
aExtProvider.AddEntityId "My source  2", aEntityIdentifier, "My value B"
aExtProvider.Save
aTr.Commit

set aTr = Profile.StartMapTransaction 
set aExtProvider = Profile.LoadExternalProvider(aCode)
set aEntityCollection = aExtProvider.GetEntityIdByIdentifier (aEntityIdentifier)
  aMessage = aMessage & vbNewLine & aExtProvider.FullName &_
    " has " & aEntityCollection.Count & " linked entities with the identifier '" &_
    aEntityIdentifier & "'"
 
Profile.MsgBox(aMessage)
Note:

In Profile Client v8 on User Interface Entity Identifier can be found and added in Organisation > External Providers > Basic > Registry.

Version information

Added in v7.8.0