2 Replies Latest reply on Aug 28, 2013 8:18 AM by DranLang

    HELP!  IF Condition only reads the first record from another portal

    DranLang

      Title

      HELP!  IF Condition only reads the first record from another portal

      Post

           Good morning everyone!  Got a situation where my IF condition won't work on other records aside from the first record from another portal.

           I have two portals from two different layouts (the portals also uses different table), my problem is when I used my IF condition written as: IF(NATIONAL_SALES =LOCAL_SALES::Sales_Desc; LOCAL_SALES::Sales_Price).

           I wanted to auto display the value of the Sales_Price automatically when an Item is selected from a drop downlist.  My first layout which contains the first portal uses the LOCAL_SALES table and the second uses the NATIONAL_SALES table.  The first portal contains two fields (Item and Price).  In the second portal I have four fields (Item, Price, Qty and Amount), the Item is a dropdown list which when clicked will show the Items from the first portal and when I choose an Item, the Price field will display the Price for that item as shown in the first portal.  I used the IF condition above but it only shows the Price for the first record from the first portal and the succeeding items doesn't display the prices for the corresponding items from the first portal (in the first layout).

           Any help/ ideas is highly appreciated.

        • 1. Re: HELP!  IF Condition only reads the first record from another portal
          philmodjunk
               

                    IF Condition only reads the first record from another portal

               More specifically, it references the first related record from the related table. If your portal is unsorted and unfiltered that will be the first record shown in a portal based on the same relationship, but with other portal options specified, the first related record might not appear in the first portal row.

               I've read your description of your layouts and portals but this does not tell me what tables your have and how they are linked in relationships. You appear to have a portal to a table named Local_Sales and another to a table named National_Sales and you describe them as being placed on two different layouts. But on what table are the Layouts based? This is specified in the "Show Records From" drop down in Layout Setup... And how is the layout's table linked in a relationship to the portal's table? And is it possible that you have one layout with two portals? Or have you given the tables for the layouts and not specified what table(s) are used for the portals?

               And most important: If you don't want to refer to the first related record each time, to what record do you want to refer? (How do you know which of the related records is the correct one to reference?)

          • 2. Re: HELP!  IF Condition only reads the first record from another portal
            DranLang

                 Thanks Phil, I got it now to work properly.  You're right about the relationship, I forgot to check the relationship.  I got the idea from one of your answer from one of my posts here, regarding the relationships of different tables and how to relate it properly.  Thanks again Phil!

                  

                 Cheers