2 Replies Latest reply on Jul 1, 2012 12:56 PM by comment

    Trying to capture data from a web viewer field to a data field?

    WhitPorter

      I have a webviewer field called ghin_lookup_url (with an object name of ghin_viewer) displaying data from this URL:

       

      http://ghp.ghin.com/GHINeNewsletters/ViewMail.aspx?ghinno=4316441&tid=9806&club=53-347-013&assoc=53-347-01

       

      Then I have a calc field called ghin_web_content.c which I want to display the HTLM source code of the ghin_lookup_url viewer field.

       

      The calc formula is : GetLayoutObjectAttribute ( "ghin_viewer" ; "content" )

       

      I'm simply trying the capture the number 13.1 which appears after "USGA HCP Index:" to a numerical FM data field called ghin_hc

       

      USGA HCP Index: 13.1

       

      Although the web viewer field displays the webpage perfectly, the field ghin_web_content.c field is blank.

       

      Using FMA 11 on a mac.

       

      screenshot attached.

       

      What is the best way to capture data from a web viewer field to a data field? Am I on the right track? Why isn't the "GetLayoutObjectAttribute ( "ghin_viewer" ; "content" )" formula working and showing me the HTYML code?

       

      As usual, any guidance thoroughly appreciated with many thanks in advance.





       


       




        • 1. Re: Trying to capture data from a web viewer field to a data field?
          TomHays

          The GetLayoutObject() calculation is being performed before the Web Viewer has finished loading the page.

           

          The "content" is only defined after the page has fully loaded.

           

          A workaround is to make the ghin_lookup_url field a plain text field.

          Fill in this field using a script.

          Attach this script to a button you can push after you see that the Web Viewer is fully loaded.

           

          Alternately you can run this script immediately but put in a pause step for enough time to ensure that GetLayoutObject() returns a non-empty result. (If you want you can loop until it is non-empty or your script reaches maximum elapsed time.)

           

          -Tom

          1 of 1 people found this helpful
          • 2. Re: Trying to capture data from a web viewer field to a data field?
            comment

            WhitPorter wrote:

             

            Why isn't the "GetLayoutObjectAttribute ( "ghin_viewer" ; "content" )" formula working and showing me the HTYML code?

             

            The most likely reason is that the calculation field is stored.

            1 of 1 people found this helpful