3 Replies Latest reply on Mar 19, 2013 7:25 AM by philmodjunk

    search multiple criteria in portal from external script

    dirgemedia

      Title

      search multiple criteria in portal from external script

      Post

           Hi I am having trouble setting up a report page.

           On the report page I have a portal and button "enter search details" which jumps me to a layout where the user selects a start date and an end date and a client name, and presses a button that takes me back to the report layout and performs a search.

           the search is suposed to return any records with creation dates between $$start and $$end where client_id = $$client (I am placing the selected options into global variables $$start $$end and $$ client).

           I am having issues with how to code the search request script. any guidence would be helpfull. probably best to assume my knowledge level is somewhere around 2/10.

            

            

            

        • 1. Re: search multiple criteria in portal from external script
          philmodjunk

               Explain what you mean by "external script".

               If the records being searched are in a different file than the script that sets the variables to values, those variables are not accessible and you'll need to use a different method to transmit the search criteria to that script.

               Please explain where "portal" comes in here. Do you want to find records in the portal's table or do you want to find records in the layout's table that have at least one portal record matching the specified criteria?

               The table occurrence context of the layout on which you perform your search will determine which of the two options for results that I just described are produced.

          • 2. Re: search multiple criteria in portal from external script
            dirgemedia

                 the report page uses a portal to display its data, by external script I only ment that I wasnt using the portal filter, all tables are in a single file.

                 I am summarising sales for a given date range for selected client from an invoice line items table and displaying them in a report via a portal.

                 Hope that was clearer.

            • 3. Re: search multiple criteria in portal from external script
              philmodjunk

                   It's not clear why you are using a portal for this. For printed/PDF'd reports, a portal is often not the best option for your layout design, though sometimes it cannot be avoided.

                   I'd think you'd want to use a list view layout based on the line items table.

                   That said, a portal to LIneItems can use either a filtered portal or a relationship based on the filter fields to display line items records for a specific client in a specific date range.

                   A possible portal filter would be:

                   Report::StartDate < Invoices::Date And
                   Report::EndDate > Invoices::Date And
                   Report::CustomerID = Invoices::CustomerID

                   This assumes the following relationships:

                   Report-------<LineItems>-----Invoices