3 Replies Latest reply on May 18, 2010 5:34 AM by 86TurboZ

    Please help with an import script issue



      Please help with an import script issue


      I know we have to upgrade as it would solve a multitude of issues. That is planned for later this year. But for now I need to do the following.  First the OS etc.


      Windows XP

      FileMaker 5.5 and 6.0 with Filemaker Server 5.5


      We have a work order system where items come in for repair and based on the model of the item we would like to 'import' parts that are neede for an overhaul. Each model has a specific list of parts. I can create a database of the model and parts but the problem is that when a new work order is created and the model is entered on that work order there is a 'work' sheet which travels around the shop to different stations. This trip sheet needs to have the parts listed based on the model entered on the work order. The trip sheet is a different database. So there are the databases associated with the work order, the database of the model and parts that go with that model and then the trip sheet.


      I can put a button on the trip sheet layout which the use must click and if the model is filled out it can take that model and find the records in the master model/parts database. But I'm have a dickens of a time trying to import those records seamlessly. What I would like is that once the button is clicked that the parts 'appear' on the trip sheet. I can script the find of the model to result its parts and I can script the return to the layout which is the trip sheet.


      But I'm having trouble getting the data from the parts list to the trip sheet.


      Once we upgrade to the new version this entire work order system will probably need to be rewritten to take advantage of the new features. But for now I just need to make this work until we upgrade.


      Any help is appreciated.

        • 1. Re: Please help with an import script issue

          I would think the creation of the trip sheet would happen from the work order?  I'm also fuzzy on a version I haven't used for seven years (and had only used for a year before moving to 7) but this should be fairly easy so I'm not sure I really understand.  You have explained your process beautifully but didn't indicate the specific problem so let's walk through it visually and let me know the point of issue:


          From the work order (after it is created and the User selects the model to be worked on) ...


          1) set a global field with WorkOrderID. You need this to tie the parts (in the trip sheet) to the work order

          2) without script parameters and variables, you will also need to set a global field with the ModelID

          3) Open the parts file and perform a search for the model

          4) Go to your Trips file and import your parts records

          5) While you still have a found set of new parts in your Trip file, use Replace Field Contents (or loop) to set the WorkOrderID and Model through those records (the PartID should be what you import).


          UPDATE:  The remaining part data can be displayed through the relationship from TripSheet::PartID = Parts::PartID. 




          • 2. Re: Please help with an import script issue

            Thank you for the reply.


            OK I was able to make this work. I had to do some things a little different but it's working wonderfully.


            Thanks again.

            • 3. Re: Please help with an import script issue

              OK, I was able to get the import to work. I couldn't get the global variable to work so I created separate scripts to copy the field I need and 'replace' the work order number in the imported set. The problem now is that when I do an import the first time it works. The second time it either can't find anything in the master database or it imports the wrong information.


              I've narrowed the problem down to the find request. I copy the model number that I want to import records for and it will work once. After that each time I do the next record the copy doesn't seem to 'copy' the proper field or if it does something in the script reverts it back to the last 'copy'.


              I have unchecked the restore find mode option on both the enter find mode and the perform find script steps.


              The other weird thing is that on the computer that I have written the scripts and performed the initial find it seems to work sometimes but on all other computers using the same database it fails each time and either pulls in the wrong part numbers or can't find the data even though the data is in the master database.


              So, I'm confused as to how in the world it can work once and not the second time.


              Please help. I know it's got to be something simple at this point but I'm just hitting my head against the wall.