cancel
Showing results for 
Search instead for 
Did you mean: 

Filling extended attribute in PDM column by copying from CDM

Former Member
0 Kudos

i have created an extended attribute for a column "Name" in CDM and marked it as "True". I have created the same extended attribute for column "Name" in PDM. I want to write a script which would copy the extended attribute value from CDM and set it in PDM. Following is the code I have written, but it's not working; can someone please help:

for each Tabl in obj.Tables

for each clm in Tabl.Columns

set ColumnInCDM = CDM.FindChildByName(clm.Name,cls_column)

call clm.setExtendedAttribute("Name", ColumnInCDM.GetExtendedAttribute("Name"))

next

next

Accepted Solutions (1)

Accepted Solutions (1)

GeorgeMcGeachie
Active Contributor
0 Kudos

A few quick points here, Amit:

  1. Unless your CDM model options prevent duplicate Data Items, your CDM attribute names will not be unique. If they're not unique, search for attributes in the entity
  2. The class you need to search for is cls_EntityAttribute, not cls_Column
  3. If you generated the PDM from the CDM, the column and attribute will already be connected via a generation link

The main point I want to make, though, is that you should not need to do this manually - if attributes and columns have the same extended attributes, you should be able to copy the values over when you generate from the CDM to the PDM.

Answers (0)