Plex 2E

  • 1.  Meta code go directly to field without using +for each field

    Posted Aug 23, 2017 02:33 AM

    I have one field for which I would like to loop through its values. Currently I am doing it like this:

    +++Define Field: FIELDS/+Name

    +for each field VariableL

        +++set value to current Field: FIELDS/+Name

        ++Name Defined Field: FIELDS/+Name, WorkL<FieldName>, .Language

        If WorkL<FieldName> == <FieldName.InvoiceStatus>

          +For Each Field Value

                      ....

     

    Is there a way to go straight to the field I want to study? In the example code I would like to go straight to VariableL<InvoiceStatus> without needing to loop through all other fields in the variable.



  • 2.  Re: Meta code go directly to field without using +for each field

    Posted Aug 24, 2017 10:20 AM

    I do not know a way of going directly to a field in a variable in meta code, but if you +++define your field, you can add meta code to only generate the If statement when the field is equal.

       +++define Field: InvoiceStatus

       +++define +CurrentField

       +for each field VariableL

          +++set value to current +CurrentField

          +if eq +CurrentField, InvoiceStatus

              +for each field value.

     

    If you only want the field values, without caring which variable it is in, it is easier still.

       +++define Field: InvoiceStatus

       +for defined value Field: InvoiceStatus

    To get the values themselves

          +for each property target fld value val

    OR to get the value triple

          +for each property Fld Value val



  • 3.  Re: Meta code go directly to field without using +for each field

    Posted Aug 25, 2017 12:55 AM

    Thanks for help. Especially the second code example would be useful because you don't need to include a dummy field in the function to read the values.