5 Replies Latest reply on Jan 22, 2012 11:04 PM by klonex

    Javascript integration

    klonex

      Hello,

       

      I´ve been looking for some documentation about javascript - activex automation, but I didn´t found almost nothing about it.

       

      Any recommendation?.

       

      Thank you so much in advanced.

        • 1. Re: Javascript integration
          beverly

          Can you tell us more? Javascript is a WEB technology and would work if called from a web page in the web viewer. The "data:" protocol can also be used sometimes in the web viewer (YMMV). Or Javascript can be used with web published FileMaker databases.

           

          What do you want to do with Javascript and FileMaker?

           

          -- sent from my iPhone4 --

          Beverly Voth

          --

          • 2. Re: Javascript integration
            klonex

            Hello,

             

            Thanks for answering.

             

            What I need to do it´s 'quick' integration of one web application which has been delevoped using php+xajax and another one which is in FM.

             

            Being more precise what I need to do is a 'click' on a webpage that shows a list of items (each one assigned to a different custommer id), and then (when I click on that item) The web page would lauch a javascript function which would lauch a FileMaker script to show the custommer profile (corresponding to a clicked item) on a fileMaker layout, from this point the rest of customer opperations would be done on FileMaker pro.

             

            First of all you should know some enviroment conditions that makes quite hard to plan another way to integrate both applications.

             

            1 - For now I have a Filemaker Server (not advanced), so I cannot use no server strategies like using PHP wrapper pages to get no parameters from web application, and have no possibility to use a ODBC/JDBC connection to web application database from FileMaker pro clients.

            2 - The only integration task needed right now could be solved adding a short javascript code on the web application (in the only point that integration is needed), which would launch a FM script on client side... and well... as far as I know, this could be easily done using javascript .... 'FMActiveDoc.DoFMScript ("whateverscript");' ... but in my situation I need to pass just one parameter to this FM script call on javascript, and this is the big issue.... I´m affraid that ActiveX object is not supporting to pass parameters into a script call, nor any method to writte on any field.

             

            I guess that Filemaker ActiveX object functionality 'is what is'  because right now there are a large amount of way to solve web integration task using FileMaker Server advanced which are much more powerful than those kind of ActiveX client-side 'patches'... anyway .. in that particular case, all the integration issue coud be solved with no more than 10 javascript lines of code, if a FileMaker Script could be called from javascript using parameters...

            • 3. Re: Javascript integration
              klonex

              Well ... finally I´ve meet a solution using a little bit different approach.

               

              What I´ve done to show on FileMaker a determinated record which profile was selected with a click on a webpage was that:

               

              1 - Modify the web page in which the customers list are shown and adding a onclick event which launch an activex object which calls a FileMaker called 'web_customer_browse'.

               

              2 - As I can not pass the customer id as parameter using this javascript call in order to directly open the customer record, what I´ve done is to do a ajax call to write a record which will be used on a different web page that will be browsed by filemaker webviewer once the 'web_customer_browse' script has been launched by javascript.

               

              3 - Finally I´ve retrieved the webviewer object content using GetLayoutObjectAttribute("WebViewerObjectName" ; "content"). Obviously the content of this web page is as easy as <mark>customer_id</mark>.

               

              Note that could appear some issues related to concurrent access to this functionality because it could be possible that some users will make a click on the web page to see customer information on FileMaker Pro at the same time, but I´ve solved it, using a 'poll' of script calls from javascript which would launch different scripts on FileMaker pro, assigned to different layouts which has different web viewers pointing to different pages where the customer´s ids are stored.

               

              I´m sure that must be over there an easier way to solve that issue, but that´s what I´ve found, and it works!. I hope it could help to some one else.

              • 4. Re: Javascript integration
                LyndsayHowarth

                I'm not entirely clear what you are trying to do here... but using FM Server as a host, you could have done it all in PHP..

                ... so rather than using GetLayoutObjectAttribute("WebViewerObjectName" ; "content") and parsing it... you could have searched and updated the FM database using PHP... and integrated with the Ajax stuff too.

                The PHP API for FileMaker allows you to create popups from valuelists in FM.... find a customer by id or generate a new one as required... etc etc. You can also use it to populate the js onclick events etc etc.

                - Lyndsay

                • 5. Re: Javascript integration
                  klonex

                  Thank you for your answer,

                   

                  Yes, you are right, my explanation about the origin of the problem was awful by my side

                   

                  To understand why I need to use a javascript for launching a script in FileMaker Pro user window, just imagine that the users are working for different porpouses with two different applications. The first one is a web application installed on their intranet, and the second one is a FileMaker Pro application.

                  The intranet web application is the users main application, but sometimes they need to view some customer information in their FileMaker Pro application (which is being used for a very different propouses than the other application), and is the 'click event' on a very specific part of th web application on the browser what should launch the FileMaker Pro actions on user side. The problem was not to create-update-shearch some information which is placed on web application databases or environment and synchronize it with filemaker database contents, the real issue on here was to 'trigger' the click acction on the web application that the users has on their screen, in order to launch a FileMaker script on client-side letting the user see some adittional information on their FileMaker Pro application when they do a click on their browser.

                   

                  May be there is an easy way to integrate under this conditions, but anyway, using the above steeps I´ve did it in just one hour, and now the users are working fine. However any ideas/suggestions are very wellcome.

                   

                  Once again thank you for answering.