7 Replies Latest reply on Jul 8, 2013 9:27 AM by philmodjunk

    Require field completion when creating a new Record

    Annette

      Title

      Require field completion when creating a new Record

      Post

           Hi,

           I was wondering another way that would require users to complete a field before they leave a layout.  I have tried using the field validation feature (not empty) but what happens when this is on is it prompts with message before they get to complete anything on the layout. 

           My layout is your basic client information layout, Name, Address, Phone, Date of Birth.  The date of birth cannot be left blank as one of the security measures in the database.  When users search for clients it will only show those within the age range of clients they see (children or adults).  All these features work fine, but the problem is when someone enters a new client, doesn't enter the date of birth, then the next time they go to search for the client is doesn't return the record because it was blank and can't veryify the age. 

           You are brought to the layout to create a new client record by a script.  the script in summary says: 

           button runs script....

           Show custom dialogue "Do you want to create a new client?

           if yes go to layout, new record request, set field (this is setting a security measure we have in place)

           Go to field (goes to the first field on the layout to begin data entry)

           Else, go to original layout.

           Now as I said the above works fine and as we want it to, I just need to add the feature of making you complete the DOB field.  When I tried to create a script that worked on layout exit it prompted with the message after every field entry which is not what I want, I just want it to happen whey they try to leave the layout. 

           Is it a layout exit script I want? And if so can someone help me write it so that I don't get prompted after every field as mentioned above? 

           Thanks very much for any help!

        • 1. Re: Require field completion when creating a new Record
          SteveMartino

               If after you set field and go to field, are you committing the data?  If so that would trigger the field validation.  But  I think If your tabbing through the fields, you should not get prompted after every field unless your clicking outside a field.  If validation is checked for not empty.I think you may want to forget field validation and use an OnRecordCommit script trigger. 

                
          • 2. Re: Require field completion when creating a new Record
            Annette

                 The field set I mention above has nothing to do with this particular issue.  It is setting a different field which has another function altogether.  I was just mentioning it so you could see the script steps in case there was a suggestion to add something in there.  On the layout I have Last Name, First Name, Street, Town, County, DOB.  The tab is set to the order they are on the layout.  So if I had validation for DOB to be not empty, as soon as the user clicked the button on another layout which runs the script above to add a new client the first thing it does is prompt to fill in the DOB.  Then if you close it and start from the beginning filling in name first as you leave each field it keeps popping up.  I need it to just check when you are done filling in the details and go to move on to another layout, much the way websites do with required fields, they don't prompt you at each field entry, they just prompt you when you click submit and say a field is missing.  

            • 3. Re: Require field completion when creating a new Record
              sameerchhinal

                   I totally agree wid STEVE MARTINO because he has describe it in the more simpler way 

                     
              •           
                                 
                •                      
                •           
                     
              • 4. Re: Require field completion when creating a new Record
                Annette

                     That's fair enough, but as I said I was/am getting the prompt after every field the way I had it set up despite you thinking I shouldn't. 

                     I will set up the script anyway that works best or as suggested but as I mentioned I was hoping to get some help writing the script correctly as what I tried myself did not work either.  I'm very new to script writing so no doubt I'm missing something very simple or obvious.  I'd be very appreciative of any help I can get because I myself am just going in circles.  I don't follow what you mean by on record commit script trigger.

                      

                     I apologise if I sound silly...I'm still learning.

                • 5. Re: Require field completion when creating a new Record
                  SteveMartino

                       Dont apologize....I'm a newbie too...still learning.  And I have asked many questions in the last year.  It may be helpful if you put up a screen shot of your validation tab, and the actual script. A few more thoughts/questions: 

                       It seems to me you may have a script trigger firing when you exit each field, otherwise you shouldnt have your problem until you try to commit the record (click outside a field, try to use a script, or change layouts).

                        

                       "So if I had validation for DOB to be not empty, as soon as the user clicked the button on another layout which runs the script above to add a new client the first thing it does is prompt to fill in the DOB.  Then if you close it and start from the beginning filling in name first as you leave each field it keeps popping up.  I need it to just check when you are done filling in the details and go to move on to another layout..."

                       Whenever you leave a layout the record commits, either automatically, prompting the validation, or you get a validation message "do you wish to save...., then if you click "save",  the validation kicks in.

                       If it's not working this way, I go back to what parameters are in your validation tab?

                        
                  • 6. Re: Require field completion when creating a new Record
                    Annette

                         I have a couple of individual fields where there are script triggers to track if information in them was changed, DOB does happen to be one of them.  It basically checks to see if the info at field entry is the same at field exit if not it places what it was and what it was changed to in an audit table I have along with the date it was changed and by whom. 

                         And yes that prompt happens when users click on say a blank part of the field too but I KNOW they will do this a lot haha.  I have users of all computer skill levels using the system so there are those that will be proficient and zoom through the fields by tabbing and others that as you know how it can be will click the wrong spot sometimes. 

                         This is kind of why I thought a script on the layout exit checking to see if the DOB field was blank would work as I thought the layout exit would be when they try to leave the page, not just a field on the page. 

                         I'm TOTALLY confused at this point!  frown

                    • 7. Re: Require field completion when creating a new Record
                      philmodjunk

                           One trick is to place an empty, invisible web viewer object on your layout, located behind all the fields and buttons and sized to cover the entire body of your layout. This object will intercept mouse clicks on the layout back ground to keep that action from comitting the record prematurely.

                      1 of 1 people found this helpful