4 Replies Latest reply on Oct 8, 2013 9:20 AM by fmscarpellini

    problem on continue script with check field

    fmscarpellini

      Title

      problem on continue script with check field

      Post

           hi

           i have a script the create a new record. then it pauses waiting for the user to complete the data entry.

           a button on layout continue the script and perform other instructions.

           if data check(defined in manage database) find an error. the script quit. there s no error captured. i don't know to handle this issue

           tnx

        • 1. Re: problem on continue script with check field
          philmodjunk

               Can you describe that in more detail? I can't quite picture what you mean by:

               

                    if data check(defined in manage database) find an error. the script quit.

               Depending on your layout design, there may be no need to pause the script, the script could select a layout, create a new blank record and quit. Other design features can, if needed, close the window, check for data entry errors, and/or return the user to a previous layout.

          • 2. Re: problem on continue script with check field
            fmscarpellini

                 i have fm in italian i hope that the translation is corret

                 the "new order" script i have created:

                 go to layout(orders: entryydata)

                 create new record

                 pause script (so the user can enter the data)

                 if $$delete=1

                 $$delete=""

                 halt script

                 end if

                 save record

                 .. and other operations

                 on the layout i have two buttons:  DELETE AND SAVE

                 the delete button perform a script (continue) called DELETEORD that set a global var $$delete=1

                 the save button simply continue the script.

                  

                 THE PROBLEM IS

                 in manage database.. filed on tab verify you set for ex that the valur must be .... and you get an error in the data is not valid

                  

                 when you click the save button  the script end and you are still in the layout and you can not continue the script  because it in not in pause.

                  

                  

                  

                  

            • 3. Re: problem on continue script with check field
              philmodjunk

                   Your delete key does not appear to do anything but set the variable to 1 and halt the script. It does not actually delete the record.

                   One option would be to split your script into three parts.

                   Part 1:

                   go to layout(orders: entryydata)
                   create new record

                   Part 2:

                   Delete Record
                   Any other steps you need after Delete Record is clicked

                   Part 3:

                   Commit Records/Requests
                   And do any other steps when the record should be saved.

                   Part 2 would be the script performed by the delete button. Part 3 would be the script performed by clicking Save. There is no longer any pause in the scripts. If you get a validation error, you can correct the error and then click Save again to save the record.

              • 4. Re: problem on continue script with check field
                fmscarpellini

                     i forget if delete=1 delete record

                     i fixed the problem this way 

                     it seams to work pretty good EVEN IF LOOKS A LITTLE BIZARRE

                      

                      

                     when the script continue after the pause

                     loop

                     set variable  $$ERR , ""

                     SAVE RECORD

                     IF GET LASTERROR =509

                     SET VARIABLE $$ERR, 509

                     PAUSE SCRIPT 

                     AND IF

                     EXIT LOOP IN $$ERR=""

                     END LOOP

                      

                     THANKS MUCH I VE APPRECIATED YOUR HELP