9 Replies Latest reply on Jul 17, 2014 6:50 PM by disabled_radiantboy

    Newbie Question: Assigning a Job(Project) to a User

      Hi Everyone,


      First time poster here -

      I'm banging my head against the wall here trying to understand whether I have the right structure in place for what I want to do.


      I'm building a simple iOS FM13 based project management solution, whereby I want to allow admins to create projects, and then assign them to specific users.

      The Users then log in and see only projects assigned to them. (They can edit and notate and add container data etc etc)


      I'm just not sure how to assign a job/project to a user and then create a job/project list for that user to see.

      I've looked through Starter Solutions for script hints and so on, and can't seem to nail it - I feel like there's a simple way to do this?


      I've done the basic and most of the advanced training for FM13, but I've obviously just confused myself! - First timer here, so please excuse the basic nature of the problem.


      Cheers, Corey

        • 1. Re: Newbie Question: Assigning a Job(Project) to a User

          The easiest way to do that is either by a scripted search. ie the search looks for and displays only those that the job has been assigned to or if you understand relationships then use a relationship to filter out the jobs for  the individual.


          In either case you will need to create a field that has the account name that you are assigned in and you will need the function Get ( AccountName ) to identify who the user is logged in as.


          Good luck

          • 2. Re: Newbie Question: Assigning a Job(Project) to a User

            Thanks Don. I'm trying to accomplish it through relationships...


            I'm not sure how to "use a relationship to filter out the jobs for the individual" If anyone could point me in the right direction here, that would be great.


            I also assume that the Get (AccountName) function will have to be part of the script upon user login?


            If anyone knows any working files that are accessible for this kind of basic login and search/result functionality, I'd sure appreciate it.



            • 3. Re: Newbie Question: Assigning a Job(Project) to a User

              Hi Corey,



              You'll want to be assigning the projects to the users by using a join table (when you have more than one user assigned to a project) or a foreign key in the project table (if there is only one person per project).  Actually the join table would work better regardless...



              Once you have the projects assigned to the user, then the real issue is somehow figuring out which user is logged in so you can show the correct projects to that user. If you (meaning the system) knows which user is logged in, then there are multiple ways of showing the user their own projects (scripted find, relationship and portal, security, etc...).



              Figuring out which user is logged in will depend on how your system is setup. If you are pretty open, you could just have a user pick themselves from a list and then go from there (with the understanding that anyone could pick anyone and see their projects). If that sounds like a bad idea, then you might want to consider storing the users's account name in their person record so you can use the Get( AccountName ) function to see who is logged in and get their Person ID (through a find, or Execute SQL function or whatever makes sense). Once you have that Person ID, then you have the info needed to make the scripted find, or relationship work.



              Hope that helps,




              1 of 1 people found this helpful
              • 4. Re: Newbie Question: Assigning a Job(Project) to a User

                I'll go further and make some assumptions. 


                Assuming you have a Users table and a Projects table.  Also assuming you have a User foreign key in the Projects table (bypassing the join table for this example).  Then you could do the following.


                1. Create a relationship between the users table and the project table: something like Users::ID = Projects::UserID.
                2. Create a field in the user table and store their account name in that field.
                3. Create a script that runs on file open that does this:
                  1. Go to Find Mode
                  2. Go to Layout based on Users Table
                  3. Set the account name field to Get ( AccountName )
                  4. Perform the find
                4. Put a portal on the Users layout that shows records from the relationship in step 1


                The logged in user will be sitting on their own user record, and looking at projects that belong to them through a portal.


                Disclaimer - the example above has been simplified for clarity, in real life it would be advised to include steps for error checking, join tables, duplicate account names, etc...


                Hope that helps,



                1 of 1 people found this helpful
                • 5. Re: Newbie Question: Assigning a Job(Project) to a User

                  Hi Chad,


                  Wow - Thats super helpful. And thanks for making those assumptions. That's exactly the what I was hoping to implement, but was fuzzy on the correct steps (and the most efficient way to structure the relationship)


                  To address your first note - This is designed to be used on about 5 or 6 ipads by different users, and ideally, they will log in with a username and password without seeing (or have any access to) projects assigned to other users. Admins will be able to see all jobs.


                  I'll give your script steps a crack tomorrow, and hopefully we see some results! - Thanks again for your help.


                  Cheers, Corey.

                  • 6. Re: Newbie Question: Assigning a Job(Project) to a User

                    Just to add another layer of confusion… 


                    Are your users on iPad always connected? Or are they "in the field" where connectivity may be questionable?


                    I haven't built something like this myself, but I saw a demo and it was pretty cool. I don't remember if it was using GoZync or MirrorSync, but it was one of those. Basically, at the start of the day, the user would log in and a script would search of all active or open jobs that are assigned to them, and download them to a local file on their iPad. Durring the day, they would make their notes (one sample was an in-home medical care provider, and another was a construction inspection crew). At the end of the day, say back at the office or just when they could get a good signal, they would sync the changes back up the FM Server. This included uploading photos, so they would usually wait until they were on WiFi.


                    It was pretty slick. The worker only saw their clients/jobs for that day at a time, so it met the privacy requirements and was pretty fast. They were only loading a handful of records each day.


                    If you are like me, even if you don't know exactly how it works, seeing what is possible gets the creative juices flowing!




                    • 7. Re: Newbie Question: Assigning a Job(Project) to a User
                      Stephen Huston

                      You might consider implementing this via the Accounts/Privilege groups Security settings. Assign a Priv Group to the users who will have records assigned to them which allows them View and Edit permissions to the Job/Project table only if "Get(AccountName) = assignedNameField". That will take care of limiting read and edit permission for all members of that group at the record level. No schema structure involved.


                      It can still be good to script the found set for jobs so that they don't see a bunch of "Access Denied" records in the list.

                      • 8. Re: Newbie Question: Assigning a Job(Project) to a User

                        Thanks Stephen. Thats very helpful.


                        At this stage, even though I understand where this is headed, I'm not convinced of my ability to write these scripts, without creating more headaches.

                        I might have to engage someone to help with this element of this little project...


                        Thanks you again, Corey.

                        • 9. Re: Newbie Question: Assigning a Job(Project) to a User

                          Thanks Chad. Yeah, that does sound similar to what I'm after...


                          The users are in the field - basically trades people who need to enter work / job details, and only see the their own jobs.


                          Those solutions sound good, but at this point, it's not my creative juices that need to flow - it's my coding juices!! Argh