1 Reply Latest reply on Jul 14, 2017 6:46 AM by coherentkris

    Custom Function

    johnw54

      I'm trying to understand this custom function.  I'm not sure what Plurality is?

       

      Function name is TableName

       

      Let(

      @Table= Leftwords(Get(LayoutName);1);

      Case (

      Plurality = 1;

      Left(@Table; Length(@Table)-1);

      @Table

      )

      )

       

      So @Table equals the first word of the layout

      If Plurality = 1 (not a field, not sure what this is)

      Then???

       

       

      The following script calls the function....

      Set Window Title [Current Window;

      New Title: GetField(TableName (2) & "::window_title")]

       

      There is the field window_title in each table

       

      the script runs on the On Record Load script trigger.

       

      The purpose of this is when you have many layouts open you can see with window title for each layout in a more descript way. 

       

      Thank you

        • 1. Re: Custom Function
          coherentkris

          Plurality is a Function Parameter.

          If it was not then you would not be able to close the edit custom function dialog box.

          What plurality means in the context of the file is all dependent on the layout naming convention.

          In your example Plurality = 2....

          TableName (2)

          this returns @Table

          If plurality was set to 1...

          TableName (1) then the function returns the layout name with the last character removed.

          Left(@Table; Length(@Table)-1)

          This suggests that the layout naming convention can have pluralization.

          i.e. layoutName or layoutNames