limj
2023-10-24 93652435728de839582440eefd5122c281181d35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Quintiq file version 2.0
#parent: #root
Method CreateConfigurableColumnString (
  shadow[LibOpt_UISnapshotAttribute] att
) as String id:Method_LibOpt_FormIteration_CreateConfigurableColumnString
{
  #keys: '[139164.5.1067713876]'
  Body:
  [*
    snapshots := construct( LibOpt_Snapshots );
    component_snapshot := att.Snapshot();
    while( not isnull( component_snapshot ) and not component_snapshot.istype( LibOpt_SnapshotComponent ) )
    {
      component_snapshot := component_snapshot.Parent();
      snapshots.Add( component_snapshot );
    }
    
    trav_rel := 'IterationPartNM.IterationPart.Snapshot.astype( ' + typeofexpression( att.Snapshot() ).Name() + ' )';
    
    filters := construct( Strings );
    filters.Add( 'snapshot.Type() = "' + att.Snapshot().Type() + '"' );
    
    
    for( i := 0; i < snapshots.Size(); i++ )
    {
      snap := snapshots.Element( i );
      parents := '';
      for( j := 0; j <= i; j++ )
      {
        parents := parents + '.Parent()';
      }
      filter := 'snapshot' + parents + '.astype( ' + typeofexpression( snap ).Name() + ' ).Type() = "' + snap.Type() + '"';
      filters.Add( filter );
    
    }
    
    snapshot_select := 'select( object, '
                    + trav_rel + ', '
                    + 'snapshot, '
                    + filters.ToString( ' and ' ) + ' )';
    
    
    
    result := 'VALUE( '
            + snapshot_select
            + '.'
            + att.AttributeName()
            + '() )';
    
    return result;
  *]
}