cancel
Showing results for 
Search instead for 
Did you mean: 

VB Script - how do you check if an attribute in an entity has no domain assigned?

Former Member
0 Kudos

I am trying to see how many attributes have domains assigned to it.

My vb script throws an error the moment it runs into an attribute that has no domain assigned.  Is there any way to check if a domain is assigned or not without getting an exception from the script?

thank you

Accepted Solutions (1)

Accepted Solutions (1)

marc_ledier
Active Participant
0 Kudos

Hi,

You simply need to compar the domain with Nothing

If you are in a CDM, you need to check the domain on the data item.

An attribute in CDM is just a relational link between an entity and a data item.

if not (attribute.DataItem.Domain is Nothing) then

... do something on domain

end if

In an LDM, you check the attribute.

if not (attribute.Domain is Nothing) then

... do something on domain

end if

Marc

Former Member
0 Kudos

Great Marc. Thank you. It works.

regards

Krishna

Answers (1)

Answers (1)

GeorgeMcGeachie
Active Contributor
0 Kudos

A a dependency matrix like this one (in the CDM, the rows must contain data items) provides a simple visual check:

In the matrix, use the 'empty rows' and 'non-empty rows' buttons to filter the attributes to show only those that do or don't have a domain specified:

You can also use the filter button to select fewer or more objects for the rows and columns: