1 Reply Latest reply on Mar 8, 2016 9:28 AM by TSPigeon

    Need Help with my Creating a record script

    thong127

      Hi Everyone,

       

      Can you please help me improving my script below its not working for me.

      Show Custom Dialog [Title: "Do you want to add materials to your record? if yes" ; Message "Enter your password"] Input Field : Material

      Password

      Exact(Materials::Material Password; Materials::Password Field)

      not Exact(Materials::Password Field; Materials::Material Password)

      Show Custom Dialog [ Title: Message ; Message: "Password unsuccessfull! Try Again"]

      Get ( LayoutTableName ) = "Materials" and not PrivExists ( $$Privs ; "Create Material" )

      Show Custom Dialog [Title:"Sorry, you do not have the necessary privileges to add New Materials."]

      Exit Script[]

      End If

      New Record/Request

      Commit Record/ Request [Skip data entry validation]

      Set field [Materials::Password; ""]

      End If

      End If

       

      Thank you.

        • 1. Re: Need Help with my Creating a record script
          TSPigeon

          thong127:

           

          Thank you for your post.

           

          I'm not a developer of course, but you may want it ordered more like this?

          Show Custom Dialog [Title: "Do you want to add materials to your record? if yes" ; Message "Enter your password"] Input Field : Material Password

          if [Exact(Materials::Material Password; Materials::Password Field)]

            New Record/Request

            Commit Record/ Request [Skip data entry validation]

            Set field [Materials::Password; ""]

          else

            Show Custom Dialog [ Title: Message ; Message: "Password unsuccessfull! Try Again"]

            Get ( LayoutTableName ) = "Materials" and not PrivExists ( $$Privs ; "Create Material" )

            Show Custom Dialog [Title:"Sorry, you do not have the necessary privileges to add New Materials."]

            Exit Script[]

          End If

           

          I hope this helps!

           

          TSPigeon

          FileMaker, Inc.