5 Replies Latest reply on Jun 3, 2014 10:37 AM by philmodjunk

    Having trouble sorting records in list view

    CalebTurner

      Title

      Having trouble sorting records in list view

      Post

           I have a basic audit file with four tables Audit, Audit_Question, Questions, Audit_Types

           Basically an audit pulls the correct questions from Questions and allows for response to the question in the audit_question join table. 

           There are 36 questions that all in to one of three audit_types: Hole Watch, Fire Watch, Bottle Watch.

           When I try to make a list layout that views only the questions from that category for that particular audit, it still shows all of the 36 questions. 

           The script I tried was Go to related record from Audit_Question using layout Audit Report.

           Find Matching Records using _fkAuditType (constrain)

           Any ideas?

        • 1. Re: Having trouble sorting records in list view
          philmodjunk

               I don't see why you would start from Audit_Question. Starting from Audit_Types makes sense as you can find or select and Audit_Type and then use that record to pull up your found set of Questions.

               But if you have these relationships:

               Audit_Types-----<Questions------<Audit_Question>-------Audit

               then this Go To Related Records script step should pull up a found set of questions on a layout based on the Questions table:

               Go To Related Record [Show only related records; From table: Questions; Using layout: "Questions" (Questions) ]

               This should work when starting from the Audit_Types layout.

               If using this from Audit_Question, you'll get just a single Question record, the Question for which the Audit_Question record records an answer. But then Find Matching Records [Replace ; Questions::_fkAuditType ]

               should find the other Questions records for this Audit type. Using Extend should also work, but not Constrain.

          • 2. Re: Having trouble sorting records in list view
            CalebTurner

                 When I create a new audit _pkAuditID is created, ex. A65, the correct set of questions are pulled and you can answer them. When I go to an Audit Report layout and I do the go to related record and then find matching records it works the first time, but if I go back to previous audits and try to pull it up in audit report it ceases to work and pulls up all 36 questions instead of the correct set. Am I missing a script step to allow this to happen?

            • 3. Re: Having trouble sorting records in list view
              philmodjunk

                   You'll need to explain this in more detail:

                   

                        When I go to an Audit Report layout and I do the go to related record and then find matching records it works the first time, but if I go back to previous audits and try to pull it up in audit report it ceases to work and pulls up all 36 questions instead of the correct set.

                   On what Table Occurrence is your Audit Report based? And what record is current at the time you do the GTRR can make a difference.

                   Exactly how do you "go back to previous audits"?

              • 4. Re: Having trouble sorting records in list view
                CalebTurner

                     I have an Audit_List layout that allows me to see all individual audits that have been created. Starting with A1, the _pkAuditID field. 

                     If you tap on one of the list items it takes you to the Audit layout, on which the audit is done using fields from the audit table and a portal to audit_question to join the answers to the questions. The correct group of records from the Questions table are selected when the user chooses either Hole Watch, Fire Watch, or Bottle Watch from a pop up field. Once the answers are completed I have a mail audit button. I had this button going to a layout called Audit Report, which used the table Audit_Question, by Go to related record, and then find matching records based on the Questions::_fkAuditType field.  Questions 1 through 14 are for the hole watch audit type, if you have done more than one audit it will sometimes show you questions 1 through 14 for as many hole watch audits have been done, or sometimes it will show question 1 through 36 even though only questions 1 through 14 were used for the hole watch audit.

                • 5. Re: Having trouble sorting records in list view
                  philmodjunk
                       

                            I have an Audit_List layout

                       This would appear to be a layout based on the Audit table.

                       

                            it takes you to the Audit layout

                       This would appear to be a second layout also based on the Audit table.

                       If you are still on this second layout... If this layout is based on the Audit table, then:

                       Go To Related Record [Show only related records; From table: Audit_Question; Using layout: "Audit Report" (Audit_Question) ]

                       Should pull up a found set of just the answers logged for the current record on the Audit layout.