1 2 Previous Next 21 Replies Latest reply on Jun 18, 2012 1:19 AM by comment

    how do I disable entries once completed

    m.mcdonell

      Basically I know that there is a messy way using 2 layouts but I wanted to know if there is a smoother way to accomplish this:

       

      After a certain field is completed on a 'invoice' for example, say the date invoiced field was completed. I would like the rest of the layout to be locked down so that even people with permissions can no longer make changes in the layout providing the date invoiced was completed.

      This would allow an easy method of ensuring no one has changed the details that may have been previously sent to a client. I would also use this method in a few other layouts. I am using FP 12 advanced and would like the method to also work seamles in FPGO.

       

      Please help?

      Thanks

      Michael

        • 1. Re: how do I disable entries once completed
          cortical

          Look at Security Privilege Sets, Records - Custom Privileges

           

          select the table, Edit : Limited and define a calculation 

           

          e.g. If(  IsEmpty(sent_date) ; 1 ; 0  )

           

          empty = 1 = true = allow edit

           

           

          this will block the record level edit, for the account/PS

           

          FMGo implications will require testing

          • 2. Re: how do I disable entries once completed
            m.mcdonell

            sorry for the delays, I just tried this and it blocks all the associated records for the particular client. Also, it puts <no access> over every field.

            Do you know of a way that keeps the visual fields intact but makes them non-editable. As if you could conditional format to say If (not IsEmpty (service:check) uncheck the edit in browse mode for each field.

            Any ideas?
            Thanks

            Michael

            • 3. Re: how do I disable entries once completed
              cortical

              <no access> over every field suggests the Field Access has been disabled. You want to customise the Edit privileges

               

              have a look at this simple  file

              login de/de  to invoke the routine_de PS

              admin account as per routine FM default

               

              custom.png

              • 4. Re: how do I disable entries once completed
                m.mcdonell

                I re-created everything that I can see but nothing seems to have worked. Any suggestions? The entry box is a checkbox for a value 1 only.

                • 5. Re: how do I disable entries once completed
                  Lemmtech

                  Easy just use script triggers to check for a value in field X and if there is one have the trigger exit the field. don't use the security model do try and do this, I avoid it when ever possible.

                  • 6. Re: how do I disable entries once completed
                    comment

                    Lemmtech wrote:

                     

                    Easy just use script triggers to check for a value in field X and if there is one have the trigger exit the field. don't use the security model do try and do this, I avoid it when ever possible.

                     

                    Pardon my being blunt, but that's a grossly irresponsible advice.

                    • 7. Re: how do I disable entries once completed
                      Lemmtech

                      to be more specific i avoid the security model for all the granular field level controls and just use it for the basic password and privilge set use. i think most of the other field level controls are uneeded and too restrictive for practical use

                      • 8. Re: how do I disable entries once completed
                        Malcolm

                        It sounds like you are putting the restrictions in the wrong place. Privilege sets take a little getting used too. Once you've got your head wrapped around them you'll find that they are the best and the easiest way to accomplish this sort of task.

                         

                        First: your situation is simple and privilege sets are designed to meet your needs. Trying to lock records any other way is harder to accomplish, takes more effort and is less secure than this method.

                        Second: In FMP12 the default privilege is "don't let them see a thing!".

                        Third: It's up to you to change that.

                         

                        The <no access> is a clear signal that you have locked down the privileges too tightly. You want to lock records in the invoice table and the invoice line items table (ie, no edit, no delete) but you do want people to be able to see the data ( field access allowed).

                         

                        Note about Lemmtech's method.

                        1. Does not prevent locked records from being deleted
                        2. Does not prevent locked records from having data modified by scripts
                        3. Only works at the User Interface
                        4. Requires a script
                        5. Requires a script trigger placed on every field from the invoice and invoices table on every layout where they occur
                        6. Do this whenever you create a new layout and place fields from those tables

                         

                        Just to compare, let's look at the security model

                        1. Protects the data at the record/data level
                        2. Able to use existing data set to establish rules
                        3. Create a privilege set and apply it to many user accounts
                        4. One rule set. It is applied universally
                        5. It has no external dependencies (scripts, script triggers, etc)
                        • 9. Re: how do I disable entries once completed
                          Lemmtech

                          Just depends on what you are trying to acommplish I like putting my security in the UI and not the securiity model in FM and I have not found this to be a problem but I don't disagree with your approach it's just not one I like to use.

                          • 10. Re: how do I disable entries once completed
                            m.mcdonell

                            Hey I agree with the secure method, although I still have difficulty with applying the first method, it is likely becuase I have not had time to figure out why it has not worked. The attached file worked perfect.

                            Although I appreciate the help, the script triggers method is messy and troublesome. As mentioned earlier, it needs on every field and what if I create a new field on the layout? It needs added in the future too. This is over 100 fields for the service order and more for the invoice (all under the same table). Too many scripts leave room for too many errors or slow down. My guys all use ipads on the filed and my other offices connect remotely. This seems like it would have a tendency to bog down when tabbing from field to field.

                            I will figure out the first method but thank you for the additonal help as your method would work to the original quesiton.

                            • 11. Re: how do I disable entries once completed
                              m.mcdonell

                              Your method is very sound and exactly what I want. I duplicated what you did (although I must have missed something) since it does nothing. I know your steps are very easy and what I thought was simple to follow.

                              Can you think of anything outside of your sample that I may have previously implemented that would keep this from working? I have the field as a checkbox with value '1' and even duplicated the field as a text to confirm that '1' was placed but nothing.

                              Thanks again

                              • 12. Re: how do I disable entries once completed
                                Lemmtech

                                Of course you need to do what you feel is best but it's only one script and it can be assiged to all fields at once when they are selected so it isn't that big of a deal to manage and it won't slow things down. It works on the same prinicpal as the method at the security level but gives you more control since you can create a custom message or take any action you want since it's a scripted action. For example the script can show a message that says "Sorry  Bob you cannot enter into this field now becasue of XXXX." or what ever you want. You could give the user and option to ask for an over ride or something if you want, none of these options are availble if the logic is locked into the security model.

                                 

                                To me if it's a data entry issue that use controls that work at the data entry level which script triggers do and give you much more control and feedback to your users then things that get triggered at the security model level which you have no control over in terms of the messages it creates or subsequest actions you may want to present your users with.  For this reason I only use the security model for things that need to be secured like layout mode, script editing, and stuff like that the rest I handle at the UI level. As I said you need to do what you feel is best for your situation but I thought I would provide more explanation as to why I personally wouldn't use the security model to address this particular issue. (my second choice would be two layouts since you can create something at the UI level to show your users the record is now locked and give them a button to unlock it if needed. I also use this approach a lot as well).

                                 

                                There is no right answer just the answer you feel is best for you in your case. Good luck.

                                • 13. Re: how do I disable entries once completed
                                  comment

                                  Lemmtech wrote:


                                  I like putting my security in the UI

                                   

                                  Hey, I like painting a lock on a door instead of installing a real one. The problem with both approaches is that they offer no security whatsoever. It's all purely cosmetics.

                                  • 14. Re: how do I disable entries once completed
                                    Malcolm

                                    To me if it's a data entry issue that use controls that work at the data entry level which script triggers do and give you much more control and feedback to your users then things that get triggered at the security model level which you have no control over in terms of the messages it creates or subsequest actions you may want to present your users with.

                                     

                                    There's nothing in the rule book that says you can't attach scripts to fields/buttons when you have used privilege sets to control data entry.

                                     

                                    Field validation messages work very well, for instance, to remind a user that the field cannot be edited because the entire record is locked, if that's the sort of thing your users need to see.

                                     

                                    In most cases someone else in the chain of command will deal with locked records. They will have a different set of privileges, such as being able to clear the "locked" flag and modify the record within the security model.

                                     

                                    Malcolm

                                    1 2 Previous Next