I'm trying to programmatically retrieve the domain of a table's field.
We only use domains in our model, as shown below:
The code is the following:
for (var counterAttr = 0; counterAttr < TableObject.Attributes.Count; counterAttr++)
{
var attr = TableObject.Attributes.GetObject(counterAttr);
Log.Information("Field[" +counterAttr +"]: " + attr.Name + " (" + attr.Domain + ")");
}
But unfortunately it outputs as follows:
Field[0]: LDAP_USED_GROUP_ID (undefined)
Field[1]: LDAP_DOMAIN_ID (undefined)
Field[2]: LDAP_USED_GROUP_NAME (undefined)
...
Any ideas?
The solution, found through Toad forums, is to use:
attr.Domain.Name
even if attr.Domain
itself is undefinded
... who knows?