10 Replies Latest reply on Oct 10, 2010 8:47 AM by JImC

    Go To Record Next Skips

    JImC

      Title

      Go To Record Next Skips

      Post

      I have a script that I use that contains :

      LOOP

       Copy [select; record_data::addimage]

       Paste [record_data::export]

      Insert Text [record_data::export;""

      Go To Record/request/page [Next;Exit After Last]

      End Loop

      Problem is it arbitrarily skips records.

        • 1. Re: Go To Record Next Skips
          LaRetta_1

          Prior to the loop, do you begin with:  Go To Record/Request [ First ] ?  Otherwise, your script would work. 

          However, you are using steps which really should be replaced with Set Field[].  Copy, Paste and Insert Text all require that the fields be on the current layout and also destroy User clipboard contents. 

          • 2. Re: Go To Record Next Skips
            JImC

            I do start with go to record/request [first]

            All fields are currently on the layout and that part has always worked great.

            • 3. Re: Go To Record Next Skips
              philmodjunk

              In Layout setup... for this layout, do you see record_data in the "Show records from" box?

              • 4. Re: Go To Record Next Skips
                LaRetta_1

                Since we obvisouly don't see all of your script, we also don't know if you have Set Error Capture[] on or off; nor do we know if you might be experiencing record lock.  Is this multi-user system?  Are there restricted privileges?  Is it web published?

                A computer will not 'arbitrarily' skip records if the script is correct.  So we can tell you the script is fine and the issue is elsewhere. You have been told that copy/paste should be replaced with Set Field[].  Whether you make that change or not isn't my concern but I would not have said it without years of full-time developer experience (and the experiences of many other developers).  We simply can't continue to guess without more information but I spot one more concern ...

                You said 'add image' ... is this a container field?  Do the data types match between the fields?  Are you using FMP Advanced so you can check for errors being thrown?

                • 5. Re: Go To Record Next Skips
                  JImC

                  Thanks for the help.

                  I do see record_data in the "Show records from" box.

                  LaRetta, i appologize if I am irritating you, I do not mean to, I am not claiming using the copy paste is better. I am using it because I have one field that I paste information from several records to create a script for another program. I don't know how I would use set field when it will replace the entire contents of the field. I need to add to the end of the data.

                  It may not be arbitrailiy skipping but I can see no pattern. I have run it multiple times and it is not consistently skipping the same records.

                  I do not know what record lock is.

                  I do not have the error capture set, not that familiar with it, you think that will help?

                  Not a multi user setup and not restricted and it is not web published.

                  Here is an example of the script I am creating:

                  _______
                  UpdateSubjectInfo(~47613~,~1001~,~*~,Street,~001.jpg~,FirstName,~Maxine Vasquez~,Lastname,~Chamith Ameresekere~,Grade,~~,p1,~~,q1,~~,p2,~~,q2,~~,p3,~~,q3,~~,p4,~~,q4,~~,Grade,~~,Teacher,~~);

                  UpdateSubjectInfo(~47613~,~1003~,~*~,Street,~003.jpg~,FirstName,~Sally Cook~,Lastname,~Jay Hocker~,Grade,~~,p1,~~,q1,~~,p2,~~,q2,~~,p3,~~,q3,~~,p4,~~,q4,~~,Grade,~~,Teacher,~~);
                  UpdateSubjectInfo(~47613~,~1004~,~*~,Street,~004.jpg~,FirstName,~Chloe Batchelor~,Lastname,~Evan Budrovich~,Grade,~~,p1,~~,q1,~~,p2,~~,q2,~~,p3,~~,q3,~~,p4,~~,q4,~~,Grade,~~,Teacher,~~);

                  ______________

                  The space between is one of the records that was skipped. See the 1001? That is the first record, there is a 1002 but it did not get in there.

                  The add image reference is a command in the script for another program. It is actually a text field.

                  I have advanced, I will check out the script debugger.

                  • 6. Re: Go To Record Next Skips
                    JImC

                    After about 10 recordss the script debugger errored on a set field command with the error 3

                    I cleared that command and it ran through about 15 records fine and then errored with the same code on
                    Go to record request/ next.
                    • 7. Re: Go To Record Next Skips
                      LaRetta_1

                      I am not irritated ... I am concerned that you are missing some important aspects and you will, like I have at times in the past, walk over a cliff because of it.  There is saying:

                      "Experience is a hard teacher because she gives the test first, then provides the lesson."  Sometimes I want to provide the lesson for someone first.

                      I have no idea why you are complicating things as you are (and you may have good reason; I just don't understand it yet).  It appears that you are attempting to make an array for an export but Set Field [] will certainly handle the same thing and can append a field just as well.  But why are you appending to one field instead of using a calculation and ony exporting the one calculation?

                      Can you upload a file somewhere so we can see what you are doing - I see no script steps here nor do I understand your structure to even advise.  If you can provide an empty clone, we might be able to assist further.  Usually we pass only the ID (which appears to be the 47613) and then the other information automatically relates.

                      "to create a script for another program."

                      With FileMaker, we only need to discuss the required output for the other program.  Can you provide that template (structure of data for the other program) so we know what has to appear?

                      • 8. Re: Go To Record Next Skips
                        JImC

                        believe it or not but I created this database a few years ago and it has been working fine. Nothing has changed with the structure. The scripts I have created with it have also worked perfectly.

                        the script I am creating has a few include statements that are not repeating and each record in the filemaker database has 3-5 commands (depending on the job at hand.)

                        I would like to check out the set field statement but I don't see how it can append to the end of the data I am creating.If you could elaborate on that I am happy to test but when I tried it set the entire field to the data.

                        At any rate, I have searched the forum and seen one other poster that had a similar problem. I don't see that he ever got an answer that solved it. It was a year old but i posted there to see if he did solve it.

                        I may be over complicating things but i did it the way I knew how. If I was a master I probably wouldn't be posting. I appreciate the tip.

                        here is a short version of the file I am creating:

                        _______________________________________

                        Include: Cmds;
                        AddOrder(~47613~,~ClientCode~);

                        AddImage( ~47613~,~Roll1~,~001.JPG~,~\\Wip_server\wip4\47613_ltt\book\001.JPG~,~srgb~);AddThumbnail( ~47613~,~Roll1~,~001.JPG~,~\\Wip_server\wip4\47613_ltt\book\001.JPG~);

                        AutoBalanceImage(~47613~,~Roll1~,~001.JPG~,~1~);

                        AutoEnhanceImage(~47613~,~Roll1~,~001.JPG~);

                        UpdateSubjectInfo(~47613~,~1001~,~*~,Street,~001.jpg~,FirstName,~Maxine Vasquez~,Lastname,~Chamith Ameresekere~,Grade,~~,p1,~~,q1,~~,p2,~~,q2,~~,p3,~~,q3,~~,p4,~~,q4,~~,Grade,~~,Teacher,~~);

                        __________________________________________

                        The AddImage, AutoBallanceImage, AutoEnhanceImage, and UpdateSubjectInfo commands repeat for each record. I import the images and the data into filemaker then use a script to copy the Include once statements and then loop through each record and paste the AddImage, AutoBallanceImage, AutoEnhanceImage, and UpdateSubjectInfo commands.

                        The 47613 number is actually a job ID. I cannot upload this right now but can maybe later.

                        • 9. Re: Go To Record Next Skips
                          JImC

                          btw,

                          here is a link to the previous post:

                          http://forums.filemaker.com/posts/4a4c30a53b#113913

                          • 10. Re: Go To Record Next Skips
                            JImC

                            Still haven't found an explanation but as mysteriously as it started it has now stopped.