4 Replies Latest reply on Aug 5, 2014 9:24 AM by mklimow

    Script has a problem running with one user




      In our currect database, we have tools that have work orders for any capital expense. In the script that runs this, i have it so when it creates a new work order then it goes into the tool layout to add the ID of the work order, so it links these two together. I have been having an issue for when one user runs the script, it will not put to ID into the field in the tool layout. for everyone else, it runs with no problems. I am not sure what is causing this and I was wondering if it may be a script problem or another problem all together. I attached images of the script itself.



        • 1. Re: Script has a problem running with one user

          In the first screenshot, you go to the different layout and do a Find[restore], but you assume that it goes well and then immediately do a Set Field.


          If the find goes wrong, or produces slightly different results then the Set Field updates the ID in the wrong record (or the find finds nothing and nothing gets set).

          Do error trapping and handling after the find.


          As an aside: for code readability you may want to avoid using the "restore" option of a find request and do it explicitly.  Much easier to troubleshoot.

          • 2. Re: Script has a problem running with one user

            the user gets the error 301: Record is in use by another user. In the script since it is popping up in a new window, could it be that since the user is in the tool record originally, be the cause for the field to not be editted?

            • 3. Re: Script has a problem running with one user

              Sure, that could be the problem. A simple commit before the new window would clear that up.


              The cause could simply be behavioral. One user may tab through the fields leaving the record uncommitted while others click and don't before running the script. Or maybe that user initiates the "new" phase far more often than the others.


              What does your "Popup Window Setup" script look like? Do you have any script triggers running on any of the layouts in this script?

              • 4. Re: Script has a problem running with one user

                The Popup Window Script just pops open the window needed, then the original script sets the layout it goes to. I ended up just setting up a button for them to click when they finished entering in the fields in the popup. Which sets the id to a variable then closes the window. I just set the field once the windows closes instead of before you are entering in data in the popup. It works this way now.