Dashboard_datamodel.zip (16.03 KB)template table is not adding in my logical model. Can you help me in the issue?
// columns are found by column name
// allowing reuse of already existing columns
// dynamic property ctemplateID is set afterwards - will keep connection to template
// column even if the name of column is changed
var t_name = "table_template";
var p_name = "ctemplateID";
template = model.getTableSet().getByName(t_name);
if(template!=null){
tcolumns = template.getElements();
tables = model.getTableSet().toArray();
for (var t = 0; t<tables.length;t++){
table = tables[t];
// compare name ignoring the case
if(!table.getName().equalsIgnoreCase(t_name)){
for (var i = 0; i < tcolumns.length; i++) {
column = tcolumns[i];
col = table.getColumnByProperty(p_name,column.getObjectID());
if(col!=null){
attr = col.getEngAttribute();
if(attr!=null){
ent = attr.getEntity();
attr.remove();
if(ent!=null){
ent.setDirty(true);
}
}
col.remove();
table.setDirty(true);
}
}
}
}
}