4 Replies Latest reply on Jul 16, 2016 4:30 PM by keywords

    how to make invoice that can not be edited or delete after data input

    jon034

      Dear all

       

      I need an invoice that after you input the data or enter an invoice, my employee can not edit it anymore or delete after it is saved or printed.

       

      Thanks

      All

        • 1. Re: how to make invoice that can not be edited or delete after data input
          planteg

          Hi jon034,

           

          this has nothing to do with the table or the way fields are created. As you know, in the inspector you may set a field to be editable or not in Browse mode. The you need two layouts: one with the fiels editable, used to create a new invoice, and one with no editable fields for looking at an already saved invoice.

           

          The best way to implement it is to have a slider on your layout, one used to create an invoice, and the other one to see an invoice without being able to edit.

           

          I also suggest putting a button on the slider page used to create an invoice to save (commit) the invoice, instead of using auto-commit, that is clicking the Layout outside a field commit automatically the record.

           

          When the user starts a new invoice, the Layout gets displayed with the slider having editable fields being active. When the user clicks the button, show a Custom Dialog saying something like "Once the invoice is saved, it can't be edited anymore. Do you wish to save the invoice ?". If the user clicks No, nothing happens, if he clicks Yes the invoice is committed by using the appropriate Scrip step, and the you switch to other slider page where fields are not editable.

          • 2. Re: how to make invoice that can not be edited or delete after data input
            RickWhitelaw

            None of this would prevent a user from deleting a record. As well the user could navigate to the editable layout and make changes to already existing invoices.

            • 3. Re: how to make invoice that can not be edited or delete after data input
              planteg

              True,

               

              that does not prevent deleting a record. That can be done through the security. Regarding navigating to the editable layout, if the OP uses a slider and control the navigation through scripts, that will make it a lot more complicated, but not impossible if he can access Layout directly from the list, but I consider no user should ever be able to do so.

               

              I suggested a way to implement what jon034is looking after. To control edition of an existing Invoice, the script attached to the save button could check Get (OpenRecordState) and prevent committing if the record as already been saved before.

              • 4. Re: how to make invoice that can not be edited or delete after data input
                keywords

                You need to look at the data validation options for the fields in question. Managing these can be a bit tricky to get right, but with invoicing systems it's pretty important that at certain stages changes may not be made. As for preventing any editing or deletion of records by certain users, account privileges is the best way.