Using field path names to retrieve field values
A
field path name provides the path to a named Entity. You can use GetLocalFieldPathNames
for a given record type and then use the returned fieldpaths
to retrieve FieldInfo objects and their contents. These field paths use a
dotted path notation (for example "owner.fullname").
When you call GetFieldValue to get a FieldInfo object, you normally do something like this, to get the value of the object:
Dim Owner
Owner = GetFieldValue("owner").GetValue()
If you wanted to get the full name of the owner and not the login name, you could write the following:
Dim MySession
Set MySession = GetSession()
Dim Owner
Owner = GetFieldValue("owner").GetValue()
Dim UserEntity
Set UserEntity = MySession.GetEntity("users", Owner)
Dim FullName
FullName = UserEntity.GetFieldValue("fullname").GetValue()
Using field path names, you can achieve the same result as follows:
Dim FullName
FullName = GetFieldValue("owner.fullname").GetValue()
For example, if a record type named Defect has a reference field Cfield to a record type named Customer and that record type has a reference field Ufield to a User record type with a field Name, then the field path of Name is:
"Defect\Cfield\Ufield\Name"
The field path name (or "dotted name) of Name is:
Defect.Cfield.Ufield.Name
You can use this path name to retrieve the value of Name. For example, using Perl:
$defect->GetFieldValue("Cfield.Ufield.Name")->GetValue();
You do not need the initial Defect if you already have a variable ($defect) referencing the Defect.