Skip to Content

Filling extended attribute in PDM column by copying from CDM

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



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 16, 2018 at 07:53 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded