10 Replies Latest reply on Aug 26, 2014 12:51 PM by jovi

    making a personal layout

    jovi

      Title

      making a personal layout

      Post

           Hi,

           I got a question.  is that any possible to make a user who login the filemaker pro and show up his or her own record in personal?  
            Like a website, when a user login with their account and password, then just show up his or her own information

           thanks

           jovi

        • 1. Re: making a personal layout
          philmodjunk

               It is possible and there are many ways to do that. You can give each person a unique account name in Manage | Security and then use Get ( AccountName ) in a number of different ways to pull up data on a layout in the database each time that they open the file.

          • 2. Re: making a personal layout
            jovi

                 great  !  I did give each person unique account and i wrote a script like this
                    

                 If (User_Account::User_Name = Get(AccountName))

                       omit record 

                       show omitted only

                 end if

                 enter preview mode(Pause)

                 and i put this script on reocrdload 

                 is any problem there or could you give any suggestion about this script ?

                 Thanks

                 jovi

            • 3. Re: making a personal layout
              philmodjunk

                   That would seem very inefficient. Put 20,000 records in that table and it could be a while before the script finishes omitting records. Perform a find instead!

                   See this thread for a number of examples of scripted finds: Scripted Find Examples

              Caulkins Consulting, Home of Adventures In FileMaking

              • 4. Re: making a personal layout
                jovi

                     Thanks PhiModJunk

                     I re write my script like this 
                     but i got a problem with the record which i want to show up that cannot be on my layout and it caused a deadlock

                     is any problem here ?

                • 5. Re: making a personal layout
                  philmodjunk

                       That script makes no sense.

                       This should be all that you need:

                       Go to Layout [ specify a layout based on User_Account or based on a table that is related to USer_Account here ]
                       Enter Find Mode []
                       Set Field [User_Account::User_name ; Get ( AccountName ) ]
                       Set Error Capture [on]
                       Perform Find []
                       If [Get (FoundCount ) = 0 // no records were found ]
                          Show Custom Dialog ["error. No Records were found." ]
                       End If

                  • 6. Re: making a personal layout
                    jovi

                         Hi,  

                         thanks it is very helpful

                         this script actually is working very well 

                         but  how come every time the code run on performfind [] that cause a  deadlock 

                         i have used the script debugger , it seen like even perform find[] got a account name , but it still went back to first line and ran all script again 

                          

                         thanks 

                          

                    • 7. Re: making a personal layout
                      philmodjunk

                           What do you mean by "deadlock"?

                           Is it possible that you forgot to clear the pause check box in the Enter Find Mode step?

                      • 8. Re: making a personal layout
                        jovi

                             I meant the script will keep running from first line to perform find[]  and then go back to first line.

                             it did not go to run   if [get(foundcount)=0]   

                              

                              

                        • 9. Re: making a personal layout
                          philmodjunk

                               That is more typically called an "infinite loop".

                               What do you do to perform the script? Are you using a script trigger?

                               It's possible that your script it tripping its own script trigger depending on what trigger you are using to perform it.

                          • 10. Re: making a personal layout
                            jovi

                                 Ok , i thought it called a deadlock   

                                 I have found where i did wrong .

                                 as you said, I put my script trigger in wrong event to run that is why it cause a infinite loop 

                                 It works right now

                                 thanks anyway