3 Replies Latest reply on Dec 3, 2012 7:24 AM by philmodjunk

    FieldStyle Not Working for Certain Layout Names

    Vinny

      Title

      FieldStyle Not Working for Certain Layout Names

      Post

           I am using the FieldStyle Function to ultimately obtain the value list name.

           I have been struggling to get this to work on one of my layouts, and just finally found that if I change the layout name, it now works...

           The function also has been working on other layouts.

           The layout name I had was "QUO" - which was short for Quotes.

           Is this a reserved word or something?

        • 1. Re: FieldStyle Not Working for Certain Layout Names
          philmodjunk

               QUO is not a reserved word. It should not effect the results of this function call.  Can you post the exact syntax that you used?

          • 2. Re: FieldStyle Not Working for Certain Layout Names
            Vinny

            Here are the steps I used to get the value list name:

            Set Variable [ $activefieldname ; Value:Get(ActiveFieldTableName) & "::" & Get(ActiveFieldName) ]

            Set Variable [ $valuelistname ; Value:Right(FieldStyle ( Get(FileName) ; Get(LayoutName) ; $activefieldname );Length(FieldStyle ( Get(FileName) ; Get(LayoutName) ; $activefieldname )) -10) ]

            When I used this on a layout named "INVC" it worked.  When I used this on a layout named "QUO" it did not work, and $valuelistname did not resolve to anything.

            I changed the layout name to "QUOT" and it worked!

            I don't understand it.  I spent hours on this one...

                  

            • 3. Re: FieldStyle Not Working for Certain Layout Names
              philmodjunk

                   The problem would appear to be the number of characters in your layout name. Note that INVC and QUOT are both 4 letters long where QUO is only 3. The right function is extracting text based on arbitrary numbers of characters so this difference in the number of letters in the name is probably the reason.

                   Try using the RightWordsand wordcount functions.

                   RIghtWords ( FIeldStyle ( ) ; Wordcount ( FieldStyle ( ) ) - 1 )