5 Replies Latest reply on Nov 19, 2012 7:09 PM by carolynhaywood

    detail button on tabbed portal

    carolynhaywood

      Title

      detail button on tabbed portal

      Post

           I have a Client_Jobs (Jobs) portal located on a Clients (Clients) layout.

           It has 2 tabs.  One shows the list of jobs for that client and the other is a detail tab which shows specifics related to that job such as address, notes, etc.

           I have a button on the portal that is supposed to take you to the detail tab of the job you selected.

           Something is not happening correctly.

           My script for the button is:

           Set Field Client_Jobs(Jobs): __kf_JobIDSeledted: Client_Jobs(Jobs); __KPJobID

           Go to object ("Claim Detail Tab")

            

           (please excuse my formating, I am not sure how to correctly show the script as I don't have it in front of me)

            

           It will go to the detail page but every job detail has the same info.  For instance, if the job number is  11.230 and I type in the notes page "sent bill to John Smith" That note will appear on all the jobs and every thing on all the other jobs will be the info on job 11.230.

           If I click on the button for job 11.240, I get the the info for Job 11.230.

           When I create a new job, for example 11.250, the detail information for that job will populate the fields in all the other job details.

            

           I have a feeling that I am doing something wrong in the script that sets up the job or the relationships:

           The job is set up on a proposal page.  After the info is entered into the requested fields the script runs to set up the job:  This is a short form of the script:

           set variables

           go to layout "Detail Job Information (Detail Job Information)

           new record/request

           set fields

           go to layout "Job Information" (Job information)

           Set field Job Information (job information) __kfjobidselected; Detail Job Information (detail job information); __kpJobID

           go to layout Clients

           go to object " View Jobs"  (where jobs are listed).  The new job shows up.

           _________________________________________

           RELATIONSHIPS:

           Clients(Clients) is related to Client_Jobs (Jobs) by __kf_Clientid 

           like this: (__Kp_ClientId = __kf_Clientid)

           Client_Jobs (Jobs) is related to Client_JobsSelected(Jobs) by __Kf_JobId

           Job information (job information)  is related to Detail Job information (Detail Job information) by __kf_jobid

           _________________________________________

           These layouts all have the same Fields ( Job Information, Detail Job information, Client_Jobs and Client_JobsSeledted)

           the tables involved are: CLIENTS, JOBS, JOB INFORMATION, DETAIL JOB INFORMATION

           the table occurances are Clients (CLIENTS), Client_Jobs (JOBS), Client_JobsSelected (Jobs), Job information (JOB INFORMATION),  and Detail job information (DETAIL JOB INFORMATION)

           ____________________________________________

            

           Any help would be greatly appreciated.  This used to work, but I don't know what I did that changed it;

           Thank you,

           Carolyn Haywood

        • 1. Re: detail button on tabbed portal
          philmodjunk

               Looks like your set field step is modifying a field in the wrong table.

               If you have this relationship:

               Client----<Jobs

               Client::__kpClientID = Jobs::_kfClientID

               and then add this relationship:

               Client_Jobs-------Client

               Client::SelectedJobID = Client_Jobs::__pkJobID

               then your set field step would be:

               Set field [Client::SelectedJobID ; Jobs::__pkJobID ]

          • 2. Re: detail button on tabbed portal
            carolynhaywood

                 Thank you!

                 I have this relationship:

                 Client----<Client_jobs

                 Client::__kp_ClientID = Client_Jobs::__kf_ClientID

                 so do I add to this relationship the following:

                 Client::SelectedJobID = Client_Jobs::__kf_JobID

                  

                 A couple more questions:  is __pkJobID the same as my __kf_ JobID or do I need to set up a new field?

                 In the create job script, is it necessary to do this: 

                  

                 go to layout "Job Information" (Job information)

                 Set field Job Information (job information) __kfjobidselected; Detail Job Information (detail job information); __kpJobID

                  

                 I am not sure why I am doing this.  I set this database up several years ago and don't remember my logic!  I think I based it on a Client_Contact portal on the clients (CLIENTS) layout.  In this case three table occurances were involved: Clients (CLIENTS), Client_Contact (CONTACT), and

                 Client_ContactSelected (CONTACT), instead of the two that I am using now:  Clients_jobs and Client_jobsselecte both of which are from table (JOBS).

                  I am at work and  don't have the script with me to tell you how they are related.  There are two other table occurances as well based on CLIENTS and CONTACT. Don't remember the relationships either as I am at work.  Anyway, those buttons work great.

                  

                 Thanks again for your help,

                 Carolyn

            • 3. Re: detail button on tabbed portal
              philmodjunk
                   

                        so do I add to this relationship the following:

                   

                        Client::SelectedJobID = Client_Jobs::__kf_JobID

                   Not quite, you need two occurences of Jobs and they need distinct names. If your existing relationship matches Client to Client_Jobs, then you need to create a new occurence of Client_Jobs and link it to SelectedJobID.

                   

                        is __pkJobID the same as my __kf_ JobID or do I need to set up a new field?

                   I don't know for sure. pk stands for "primary key" and almost always denotes a field define as an auto-entered serial number field that uniquely identifies each record in the table. kf stands for "foreign key" and is usually a simple data field that matches to a primary key field from a related table.

                   

                        is it necessary to do this: 

                   

                        go to layout "Job Information" (Job information)
                        Set field Job Information (job information) __kfjobidselected; Detail Job Information (detail job information); __kpJobID

              Whoa! where did "job Information" come from? What table and what table occurrence is that? This is completely new information not in your original post. You might need to post a screen shot of manage database | Relationships and include explanations of each table occurrence box shown in that window and which are specified for your layout and which for your portals.

              • 4. Re: detail button on tabbed portal
                carolynhaywood

                     Here are my relationships

                     Clients (CLIENT)::__kp_ClientID  = Client_Jobs (JOBS):: _kf_ClientID

                     ____________________________________________________________

                     Client_jobs(JOBS)::__kp_JobID = Client_JobsSelected(JOBS)::__kp_JobID  AND

                     Client_Jobs (JOBS)::_kf_jobidselected = Client_JobsSelected::__kp_JobID

                     _____________________________________________________________

                     Separate from these is this is this relationship:

                     Job information detail (JOBS)::__kp_JobID = Detail job information (JOBS)::__kpJobID

                     ___________________________________________________________

                The script to create the job, starting from a proposal page (PROPOSALS)  is this: (shortened)

                     set variables

                     go to layout 'detail job information (JOBS)"

                     new record

                     set fields

                go to layout "job information (JOBS)"

                set field {Job information detail::_kf_jobidselected;Detail Job Information::_kf_jobidselected}

                     commit records

                     ______________________________________________________________________

                     I don't remember what the bold steps do for the job creation. Now,  When I leave these bold lines in the script, I get nothing on the detail tab.  When I take these lines I get nothing on the detail page.  If I leave out "to to layout "job information (JOBS)  leave this line in: set field {Job information detail::_kf_jobidselected;Detail Job Information::_kf_jobidselected}, I get to see the detail tab put all are populated with the info from the job I just created.

                      

                      

                     All information needed is on the layouts, job information, client jobs, client jobs selected, and detail job information

                     ______________________________________________________________________

                     The portal is Client_Jobs (JOBS).  The fields on the first tab are from Client_Jobs (JOBS).  The fields on the second tab (the detail tab) are from Client_JobsSelected(JOBS)

                      

                     The script to make the button go to the View detail tab on the Client_Jobs (JOBS)  portal on the Client layout (CLIENT) is:

                      

                     Set Field Client_Jobs(Jobs): __kf_JobIDSeledted: Client_Jobs(Jobs); __KPJobID

                     Go to object ("Claim Detail Tab")

                      

                     When a new job is created, it shows correctly on the View Job Tab, but clicking on the button to view the details of any job now shows nothing and I can enter nothing.  Earlier this morning, I could see data but it would be the same data for all jobs.

                      

                     HELP!!

                      

                     Thank you

                • 5. Re: detail button on tabbed portal
                  carolynhaywood

                       I DID IT!!

                       Thank you so much.

                       I unconnected the relationship between client_jobs and client_jobsSelected

                       Connected client to client_jobsSelected by the relationship you mentioned above

                       and set field like you said.

                       IT WORKS WONDERFULLY TERRIFIC!

                       Thanks again, (You really can never know how grateful I am)

                       Carolyn Haywood