Skip to Content
0

Filling extended attribute in PDM column by copying from CDM

Jul 13 at 10:41 AM

19

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
George McGeachie Jul 16 at 07:53 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded