9 Replies Latest reply on Dec 7, 2011 4:54 AM by Lizhe

    Issue of "Insert file" (original title: A bug in the script of "Insert file"?)

    Lizhe

      I tried to report the issue from my FM Pro from the Help menu, but could not find the bug report page. So I post here to see if this is a real bug or sth I did wrong (or mis-understood the script set)...

       

      I remote accessed a file in FM server 11 from FM 11 advanced (both in Window environment) and run a script at a given layout. The script has a step of "Insert File(reference, field name, path) to attach a file into a container field, which is on the given layout.

       

      I found: if I checked the option "Prohibit modification of value during data entry" of the container field, the above script step would generate an error (code: 3); if the option of the container field was not checked, the script step would run through without error.

       

      Thanks.

        • 1. Re: A bug in the script of "Insert file()"?
          Stephen Huston

          Hi Ryan,

           

          This sounds like expected behavior. You prohibit modification and it throws and error when you try; you don't and it doesn't. But I realize that scripted edits are not quite the same as "data entry" editing.

           

          However, your script might behave a little differently when the prohibit flag is enabled for the field if you either run the script with Full Access permissions or if you set error capture on just before the Insert step, but I warn you that I haven't tested this in along time on a container field.

           

          Another thing to check is that the target field is or is not a global, and whether any permission-level access to the field has been modified from its default  of being modifieable for the user's permission group.

          • 2. Re: A bug in the script of "Insert file()"?
            sporobolus

            on 2011-12-06 09:25 RyanTX wrote

            I tried to report the issue from my FM Pro from the Help menu, but could not find the bug report page. So I post here to see if this is a real bug or sth I did wrong (or mis-understood the script set)...

             

            i don't think this is a bug in FileMaker, but see this thread for info about

            submitting bug/issue reports for FileMaker Pro:

             

            https://fmdev.filemaker.com/message/64009#64009

             

            (note you will have to sign into the forums)

             

             

            The script has a step of "Insert File(reference, field name, path) to attach a file into a container field, which is on the given layout.

             

            I found: if I checked the option "Prohibit modification of value during data entry" of the container field, the above script step would generate an error (code: 3); if the option of the container field was not checked, the script step would run through without error.

             

            it says "prohibit modification during data entry" but it means during data

            entry or when running a script; running the script with Full Access, or

            turning off the "prohibit" flag, will let the script run; consider using the

            Field Behavior instead of Prohibit Modification to stop users from directly

            modifying the container

            • 3. Re: A bug in the script of "Insert file()"?
              Lizhe

              Hi Stephen,

              Yes, the script is with Full Access and I did set error capture on at the begnning of the script but not just before the Insert step. The container is not a globale field. The solution is still in the development stage. I run it as a admin and no permission has been set for the field.

               

              Thanks.

               

              Ryan

              • 4. Re: A bug in the script of "Insert file()"?
                Lizhe

                Is it only related to the Container field? I have this question because there are other fields with "Prohibit modification of value during data entry" in the solution being modified by scripts. So I'm a bit confused...

                Thanks.

                • 5. Re: A bug in the script of "Insert file()"?
                  sporobolus

                  on 2011-12-06 10:49 RyanTX wrote

                  Is it only related to the Container field? I have this question because there are other fields with "Prohibit modification of value during data entry" in the solution being modified by scripts. So I'm a bit confused...

                   

                  odd because your scenario works for me with full access on, gives error 3 with

                  full access off

                  • 6. Re: A bug in the script of "Insert file()"?
                    Lizhe

                    Your result makes a perfect sense to me. At least, I know it is not FM problem and there must be other settings in my solution which caused the problem. Thank you very much.

                    • 7. Re: A bug in the script of "Insert file()"?
                      thosliot

                      How are you modifying the other fields? I ask because I believe that the various Insert script steps are treated as data entry whereas Set Field is not.

                       

                      cheers

                       

                      Tom

                       

                      On 6 Dec 2011, at 17:48, RyanTX wrote

                       

                      Is it only related to the Container field? I have this question because there are other fields with "Prohibit modification of value during data entry" in the solution being modified by scripts. So I'm a bit confused...

                       

                      • 8. Re: A bug in the script of "Insert file()"?
                        Lizhe

                        Hi Tom,

                         

                        You are right that I used Set Field for other fields in the script. Now I learned the Insert Field script steps are treated as data entry. Thank you so much.

                        • 9. Re: A bug in the script of "Insert file()"?
                          Lizhe

                          The problem was solved. Thank you all for help.

                           

                          BTW, I could not find the problem solved button on the page to label the status of this post. I guess I did something wrong when I started it. If you know how or why, please point it out to me. Thanks.