3 Replies Latest reply on Jun 9, 2014 2:01 PM by philmodjunk

    Reusing Portal records

    lowededwookie

      Title

      Reusing Portal records

      Post

           I'm building a job logging system and I currently have three tables.

           The first is a company table which essentially has the Company details such as site address.

           The second is a contacts table which holds the site contacts

           The third is a job sheet.

           The problem I'm having is the job sheet. What I need it to do is connect to the company and then a user associated with that company.

           If the company does not exist then I need the Job Sheet to allow me to create a company and then a user associated with that company. If I use a Portal then how do I select just the company I need then just the user I need?

           I'm thinking I need unique names on the company but if I use unique names on the users will it spit the dummy when a user with the same name but with a different company needs to be setup?

           I'm also thinking to allow selection of specific companies and users I would need to do some scripting but I can't work out how exactly to do this. Do I use a drop down or can I find some way of finding records based on me typing into a box?

           I think if I can get this sorted the rest of what I need to do will come so smoothly.

        • 1. Re: Reusing Portal records
          philmodjunk

               This does not appear to have much to do with "reusing portal records".

               The first part of your data model seems obvious:

               Company----<Contacts

               In other words, one Company links to many Contacts.

               But how did you link in Job Sheets in your relationships. Do they link to a contact (this contact is responsible for this job) or to a company?

          • 2. Re: Reusing Portal records
            lowededwookie

                  On the Job Sheet the jobs will be created against a user, the user is part of a company. This is the easy bit and I have no problem with this.

                 The problem I have is that currently to create a job I would need to go to the Company, then to the User, then create that way in order to create a job. I want to be able to do this from the Job Sheet first.

                 Essentially each company has a number of users and each user could have a number of jobs. However sometimes a job doesn't get assigned to a user at all but does get assigned to a company. An example of this might be a user gets a job assigned to him because his computer died, however for a cabling job where a number of people will be affected or there is a person coming who hasn't started and they're prepping for them to arrive the job would be assigned the company.

                 If I go the long route then adding these jobs is quite easy but I want to make the system easy to use not long winded. I was thinking about this last night and am thinking that maybe using drop downs would be easier with one drop down for the company and another for the users but I'm thinking that this could over time get unwieldy which is why I wanted the ability to reuse a record ala Bento.

                 In Bento if I wanted to achieve this I could simply go to the "portal" record that I want and select it. I know Bento was doing a hell of a lot of work behind the scenes to achieve this but I can't work out how to achieve this in FM.

            • 3. Re: Reusing Portal records
              philmodjunk
                   

                         On the Job Sheet the jobs will be created against a user, the user is part of a company. This is the easy bit and I have no problem with this.

                   Yes, but if I don't understand what you have set up, it's pretty hard to help you. Is "user" and "contact" the same thing? Does this mean that you need to link each "job sheet" to a specific contact or not?

                   Assuming that the answer to that question is "yes", it would appear that you have or should have these tables and relationship but with your field and table occurrence names used in place of mine:

                   Companies-----<Contacts-------<JobSheets

                   Companies::__pkCompanyID = Contacts::_fkCompanyID

                   Contacts::__pkContactID = JobSheets::_fkJobSheetsID

                   This assumes that one company can have many contacts but a contact can have only one company. This assumes that a contact (user) can have many job  sheets assigned but that any given job sheet has only one contact assigned. Please confirm whether this is correct as this is not the only way you might need to set this up. As an example, in some organizations, you might need to link multiple contacts to the same job sheet as well as many job sheets to one contact--creating a many to many relationship.

                   For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained