2 Replies Latest reply on May 2, 2012 3:30 PM by Embee

    Problem with the "Clear" script step

    Embee

      Title

      Problem with the "Clear" script step

      Post

      Hi fmp's

      I'm having a problem with the Clear field script step, as it works perfectly so long as the field to be cleared is on the layout.

      But when I remove the field from the layout (while keeping it in the layout's table-occurence of course. it is a global field used for dictating some interface-stuff), the field is no longer cleared when using the script.

      Is that supposed to happen? If not what am I doing wrong? And if yes, what can I do instead?

      I hope you guys can help.

      - Embee

      (fm12)

        • 1. Re: Problem with the "Clear" script step
          philmodjunk

          Clear is one of the script steps that silently fail if the specified field is not present on the current layout.

          Copy, paste and steps starting with "insert" also have this limitation.

          Don't see why this was ever a limitation with these steps and the fact that you won't know that a layout change affected one of these steps unless you either spot the change in how the script works or test for success with a get ( lastError ) function call in an IF step immediately after one of these steps definitely makes for potential trouble--as a layout change months after the script was created can trigger real havoc in your database.

          I avoid using all of the above script steps if it is possible to do so.

          Use Set field with "" as the second parameter to clear your field and you will no longer need to keep the field on the layout.

          • 2. Re: Problem with the "Clear" script step
            Embee

            Hi Phil,

            I was just doing the "" and writing a new post, when I saw that you had answered. Thanks a lot for the clarification on Clear and the other steps of the same nature. That should soooo be written in fm's online reference help.

            Thanks again

            - Embee