Plex 2E

 View Only
  • 1.  Can you get a fields surrogate value using metadata?

    Posted Nov 17, 2016 07:28 AM

    I have a grid on a winc panel I want to loop all the fields in the grid and then loop all the properties to get either a unique identifier of the field (object surrogate key) or the field name witch you define when creating the field in plex not the left label.

     

    I have the following but not sure exactly what the property needs to be :

     

    +++Define Field: AbbreviatedName
    +For Each Field MyGrid
      +For Each Property Target TRP for NME
       +++Set Value To Current Field: AbbreviatedName
       ++Name Defined Field: AbbreviatedName, MyGrid<AbbreviatedName>
        Append MyGrid

     

    Thanks



  • 2.  Re: Can you get a fields surrogate value using metadata?

    Posted Nov 17, 2016 08:06 AM

    I got it working, did not know you dont need to loop the properties you only have to loop the fields to get the actual name..

     

    +++Define Field: AbbreviatedName
     +For Each Field MyGrid
        +++Set Value To Current Field: AbbreviatedName
         ++Name Defined Field: AbbreviatedName, MyGrid<AbbreviatedName>
        Append MyGrid

     

    But if there's a way to get the field surrogate key please reply



  • 3.  Re: Can you get a fields surrogate value using metadata?
    Best Answer

    Posted Nov 17, 2016 08:49 AM

    Hi renierne,

    for

    ++Name Defined Field: AbbreviatedName, MyGrid<AbbreviatedName>....

    use ++Name Defined Field: AbbreviatedName, MyGrid<AbbreviatedName>,.Surrogate/SurrogateName (as you prefer)

     

    Syntax: ++Name Defined metavariable, resultfield, name preference

    having following options for preference:.Host, .Language, .Library, .Model, .Scoped, .Surrogate, .SurrogateName, .Unscoped