3 Replies Latest reply on Jan 20, 2012 9:15 AM by philmodjunk

    Lock and email portal records to edit once submit button is clicked

    ShaikhAtta1238

      Title

      Lock and email portal records to edit once submit button is clicked

      Post

      I am working on a work plan which has a portal of acitivties, I want that once the user has completed the workplan and fills in all the acitivties and then when he/she clicks the submit button the portal should be locked for editing and the report of the workplan should be email in PDF to xyz@gmail.com

       

      Thanks alot for the support. 

        • 1. Re: Lock and email portal records to edit once submit button is clicked
          philmodjunk

          To send a PDF, first the script uses save as PDF with a variable to control location and name of the PDF file thus created: Found Sets to PDF with unique file names

          Then you can specify the same variable as the attachment for your email in the Send Mail script step. Thus, your user can click a button and the script first generates, then emails the PDF.

          To "lock" the portal, do you just want to lock this portal on this one layout or do you want to lock portal's records, no matter where they are accessed in your database.

          You can use Manage | Security to control access to records on a record by record basis: See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a detailed description of how to set this up.

          You can set script triggers that refuse entry into fields in the portal if the parent record's "lock" field has been set by your email script.

          You can also set a validation rule such as:

          Not ParentRecord::Lock

          to reject all additional changes and data entry if Lock is a number field in the parent record that your script sets to 1 in order to lock the record. Please note that sometimes it's best to include all of these "locks" for the same issue.

          • 2. Re: Lock and email portal records to edit once submit button is clicked
            ShaikhAtta1238

            thanks Phil, 

                                 Basically I the way you are talking about if the parent field is locked the users will not be allowed to enter anything in the portal. Can  you please guide me how to create the script on the buttong and what the script will be if

             

            table 1

            WorkplanID (Parent linked field)

             

            table 2

            workplanID (child linked field)
            Acitvity 
            Project target  
            Achieved target

             

            Now i want when the button is clicked the parent record  WorkplanID is locked and the user can't make any changes to the child records in the portal. 

             

            hope fully you have got my point. 

            thanks again

            • 3. Re: Lock and email portal records to edit once submit button is clicked
              philmodjunk

              The button can perform a single line script:

              Set Field [WorkPlan::LockStatus ; True ]

              You then create access control expressions in manage security, validation rules and/or scripts that check the value of this one field to control access to the records in both the parent and child table.

              We use this method here to prevent employees from accidentally modifying an invoice after it's status changes to "printed".