3 Replies Latest reply on Mar 26, 2014 8:18 AM by philmodjunk

    List of values are in the reverse order

    Badam

      Title

      List of values are in the reverse order

      Post

      I am using a script step to create a list of values as a variable:

           Set Variable {$VendorList; Value:List(Parts List PO 3::Primary Supplier_ID)

           The values I am capturing are in a portal. I also capture other lists of values from the same portal.

           For this list of values, when I look at them in the data viewer, the list of values are in the reverse order compared to how they appear in the portal. The other lists are in the correct order.???

        • 1. Re: List of values are in the reverse order
          philmodjunk

               It sounds like you have a sort order specified in Portal setup to arrange your portal records in a particular order. Calculations such as List will ignore such sort orders and use the sort order options specified at the relationship level instead.

               Open portal setup and figure out the specified sort order unless this is obvious to you without checking. Then go to Manage | Database | Relationships, find the two table occurrences for layout and portal and double click the relationship line that links them. In the dialog that appears, click the sort button on the portal table's side and specify the same sort order that you have specified in portal setup.

               PS: An alternative approach that leaves your current sort order settings unchanged would be to replace the list function with an ExecuteSQL function call that uses the ORDER BY clause to specify the desired sort order.

          • 2. Re: List of values are in the reverse order
            Badam

                 Thanks for the help. I have no sort order specified in the portal (the sort box is unchecked). In the relationship the sort box is also unchecked. GIven this should I create a sort within both areas and make them match?

            • 3. Re: List of values are in the reverse order
              philmodjunk

                   If there is no sort order specified, the order returned by the List function should match. That makes me wonder if you checked in the correct place in Manage | Database | Relationships.

                   I doubt that there is any need to specify a sort order for both the portal and the relationship. If you specify a sort order in the relationship, it will also be the order in the portal unless you specify a different sort order in portal setup.