PersonAgent and its SavePersonEntity method.
Code
CS
Walk-through
We need to use theGetPersonEntity method available in the PersonAgent to retrieve the PersonEntity that needs to be updated.
Once the Entity is retrieved, the properties that are exposed can be updated. The example shows how we can update different types of properties exposed by the PersonEntity.
Entity types consist of simple data types such as String, Boolean, DateTime, and int and complex data types consisting of types such as LocalizedFields and EntityElement types.
Updating simple data types
Simple data types can be updated with basic statements as shown below.CS
Updating complex data types
However, complex data types cannot be modified in such a way. For example, if we need to update theAddress property of the Person we need to first create a localized field array and store the new address in the declared variable. Only once this is done can it be assigned to the Address property of the PersonEntity.
CS
EntityElement array and assigned values to the properties of the declared variable.
CS
Emails property of the PersonEntity by executing the statement below.
CS
CS
CS
Position property of the Person.
Position property uses pre-defined SuperOffice values, which are different from the title.PersonEntity have been modified the modifications could be saved to the database with the execution of the below statement.
CS