2 Replies Latest reply on Mar 11, 2016 12:11 AM by thomas.colleoni

    Script Error 301 in FM Server 14

    thomas.colleoni

      I have a problem with a solution hosted on our dedicated server (Windows).

      Even if i am the only user logged in - username "admin" - using FM Pro 14, everytime i try to run some particular script on the server (PSOS) i get the following error in the server log:

      "Program scriptname - admin 1" script error (301) in solutionname : Set field by name

      "Program scriptname - admin 2" script error (301) in solutionname : Set field by name

      "Program scriptname - admin 3" script error (301) in solutionname : Set field by name

      "Program scriptname - admin 4" script error (301) in solutionname : Set field by name

      "Program scriptname - admin 5" script error (301) in solutionname : Set field by name

      ...

      and so on.


      The problem is that everytime this script error is showed, the script fails and i miss data.

      I know that the error 301 appears when the record is used by someone else, but i'm the only user logged in - it seems that the script can't write in the target field because it is used by myself (or some previous "script session" of mine)?

      I don't know what to do, any help?

      Thank you

        • 1. Re: Script Error 301 in FM Server 14
          coherentkris

          Check to see if the script is opening multiple windows or doing anything that would cause record lock.

          Maybe post the script?

          If you are 'missing data" you should refactor the process so that if the script fails then the entire transaction is canceled.

          • 2. Re: Script Error 301 in FM Server 14
            thomas.colleoni

            Hi coherentkris,

            thank you for your answer.

            This is the situation: i have a layout working on a table with a single record and many fields, which values are updated by scripts every time this layout is loaded, or some of its fields are modified.

            1 - There is a script performed on the client machine once the specific button is pressed, that just checks if the solution is hosted on a server or on a FMPro machine, and starts a "Perform script" or "Perform script on server" accordingly;

            2 - A first script is called, composed by a loop, "set variable", "set field", "set field by name", "go to layout" script steps only. No multiple windows or record locks (as far as i know).

            3 - After the script "2" has finished its tasks, another script is started. This script loads some numbers from other tables, process them and then using again a loop, "set variable", "set field", "set field by name", "go to layout" script steps only it updates the field values of the layout.

             

            I don't know how to post the script steps...

             

            The script "3" is also used in other script combinations, as it is the script used to load and show the actual values of the layout fields.

             

            Another important information is that if i click on the layout, (committing the record?) then i don't have the "301" error.

             

            Another question: is it normal that the server log  is adding a sequence number to my username to show the user who started the script? i mean, yesterday when i started it was "admin 1", now it is "admin 168".