Quintiq file version 2.0
#parent: #root
Method RefreshShadowObjects () id:Method_FormKPIColumns_RefreshShadowObjects
{
  #keys: '[139544.3.27235791]'
  Body:
  [*
    owner := DataHolderOwner.Data();
    
    // Delete KPI columns no longer necessary
    kpi_defs := selectset( LibOpt_BT_BenchmarkTrackingDataset, KPIDefinition, kpi, true );
    traverse( owner, UIKPIColumn, kpi, kpi_defs.Find( kpi.KPIDefinition() ) < 0 )
    {
      kpi.Delete();
    }
                                                                  
    // Create new KPI columns
    existing_defs := selectset( owner, UIKPIColumn.KPIDefinition, kpidef, true );
    traverse( kpi_defs, Elements, kpi, existing_defs.Find( kpi ) < 0 )
    {
      owner.UIKPIColumn( relnew,
                                 KPIDefinition := kpi );
    }
  *]
}
