0

Using the out of the box WDE customization framework, is it possible to read from the annex of a custom business attribute?

Eric Scherrer
  • 3,328
  • 1
  • 19
  • 34

1 Answers1

0

This worked for me:

Private field:

private readonly IConfigurationService _configurationService;

Your Ctor:

public YourThing(IConfigurationService configurationService)
{
    _configurationService = configurationService;
}

Somewhere in your class:

string dispositionBusinessAttributeName = [get your BA name here]; 

CfgEnumerator cfgEnumerator = _configurationService.RetrieveObject<CfgEnumerator>((ICfgQuery)new CfgEnumeratorQuery()
{
    TenantDbid = _configurationService.WorkingTenant,
    Name = dispositionBusinessAttributeName
});

CfgEnumeratorValueQuery enumeratorValueQuery = new CfgEnumeratorValueQuery();
enumeratorValueQuery.EnumeratorDbid = cfgEnumerator.DBID;
enumeratorValueQuery.TenantDbid = _configurationService.WorkingTenant;

ICollection<CfgEnumeratorValue> cfgEnumeratorValues = _configurationService.RetrieveMultipleObjects<CfgEnumeratorValue>((ICfgQuery)enumeratorValueQuery);
Eric Scherrer
  • 3,328
  • 1
  • 19
  • 34