3 Replies Latest reply on Apr 12, 2013 1:09 AM by hjgunn@mmedia.is

    Problem running FM script from cwp

    hjgunn@mmedia.is

      I was having problems with calling a Filemaker script from an XML query against FMServer 12v3 on a MacMini server running OS 10.6.8

      I then figured out the problems and got the process up and running.

       

      ===

       

      But now, if I edited the record in Filemaker and then ran my query the changes I made to the contents of the layout's field woul not show up.

      If I then waited a while and ran the query again the record would update.

       

      I then added a script trigger to the fields on the layout being accessed by the query.

      This trigger did nothing except commit the record on field exit.

       

      Now the script I'm triggering from the query runs and actually updates the fields it is supposed to update.

       

      ===

       

      Now I wonder if one has to make sure manually, that a record being edited and then being accessed by an XML query, has been commited?

      Any comments?

       

      TIA

      Hans

        • 1. Re: Problem running FM script from cwp
          LyndsayHowarth

          Are you doing any other updates in the call or just running the script?

           

          I have never had any problems with updates being committed with or without a script.

           

          Have you considered putting a commit records at the beginning of your script?

           

          - Lyndsay

          1 of 1 people found this helpful
          • 2. Re: Problem running FM script from cwp
            Stephen Huston

            Part of the issue is getting the BROWSER window refreshed with the newly-cached record in any kind of web publishing. Go To Layout commands can force a screen refresh, among others.

            1 of 1 people found this helpful
            • 3. Re: Problem running FM script from cwp
              hjgunn@mmedia.is

              Thank you both for your comments.

               

              This thing is actually much simpler than feeding a webpage.

              I'm simply making one query (FMPXMLRESULT) to move a record from a FM table to another database system.

              I then do a second query (fmpresultset), passing a parameter to the script, to run the script in order to set a flag telling the FM system that the record has actually been copied to the other system.

               

              I am a complete novice at working with cwp so I could be doing this completely wrong without even knowing it.

               

              I use the FMPXMLRESULT grammar as the reply is less complex and I started using fmpresultset because FMPXMLRESULT gave me an error when I tried to run a script from it. It probably doesn't support the run script functionality or something.

               

              Actually I haven't found any information on which grammars support what functionality.

               

              ===

               

              My problem then turned up as I ran the query running the script and then went into FM and reset the flag for another go by the script.

              I reset the flag, ran the script and the flag woud not get set. If I however moved to another record first the flag got set.

               

              Inserting a commit script step will probably be the remedy to this issue.

              But I was wondering if it was indeed necessary to commit a record before tampering with it from cwp and why this is so.

               

              Kind regards

              Hans