How to read the annex of a business attribute in Workspace Desktop Edition?

274 views Asked by At

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

1

There are 1 answers

0
Eric Scherrer On BEST ANSWER

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);