2 Replies Latest reply on Dec 8, 2008 2:01 PM by ralvy

    Function question

    ralvy

      Title

      Function question

      Post

      Is there a way to compose a script to grab the value of a field in the current layout without knowing ahead of time which layout that will be? That is, say I have 5 different layouts that have a Last Name field. I'd like a single script to, among other things, grab the value in the current layout's Last Name field. I don't see how to do that. I guess I need to be able to use something like

       

      <current layout>::Last Name

       

      in the script.

        • 1. Re: Function question
          Orlando
            

          Hi ralvy

           

          Are all your layouts using the same Table and is the layout based on the same Table Occurrence?

           

          If so then the calculation in your script just needs to reference the field directly

           

            TABLE::Last Name

           

          However if it is not this simple then you could give the fields on all your layouts Object Names, via the Object Info toolbar, and then in your script you will reference the name, which will be the same for the same field on all your layouts, you then use the GetLayoutObjectAttribute function in your calculation to get the value of the field

           

            GetLayoutObjectAttribute ( "Last Name" ; "Content" ) 

           

          This assumes you gave all your last name fields the Object Name "Last Name".

           

          I hope this helps.

          • 2. Re: Function question
            ralvy
               Thanks. GetLayoutObjectAttribute does the job.