Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.31 KB

XrmFrameworkUtilities.md

File metadata and controls

46 lines (31 loc) · 1.31 KB

XrmFramework Utilities

Entity extensions

OptionSetValues

Get Enum value from OptionSetValue

GetOptionSetValue

AccountType type = accountEntity.GetOptionSetValue<AccountType>(AccountDefinition.Columns.AccountType);

GetOptionSetValue with defaultValue

AccountType type = accountEntity.GetOptionSetValue<AccountType>(AccountDefinition.Columns.AccountType, AccountType.Client);

Set OptionSetValue from Enum

accountEntity.SetOptionSetValue<AccountType>(AccountDefinition.Columns.AccountType, AccountType.Corporate);

Attribute Values

Get attribute value with default Value specified.

string name = accountEntity.GetAttributeValue<string>(AccountDefinition.Columns.Name, "default value");

Get Attribute value from a main entity and looking to find the value in the preImage entity specified.

string name = accountEntity.GetAttributeValue<string>(preImage, AccountDefinition.Columns.Name, "default value");