7 Replies Latest reply on Jan 9, 2017 9:12 AM by philmodjunk

    how to automatically read new record based on a relationship between two tables

    yodajing

      Two tables have a relationship based on following condition.

       

      A::value1 > B::value2

      AND

      A::value1 <= B::value2

       

      And I have one field, fieldA, of A, and that field is updated with the a field, fieldB, of B which is selected by above condition.

       

      But, if I change the A::value1 to read another record, it does not automatically change the record.

      That is still showing the old one. So fieldA has the old value.

       

      How could I make the app read the record based on updated condition?

        • 1. Re: how to automatically read new record based on a relationship between two tables
          electon

          yodajing wrote:

           

          Two tables have a relationship based on following condition.

           

          A::value1 > B::value2

          AND

          A::value1 <= B::value2

          This relationship is going to give ANY related record.

           

          A > B and A <= B, you ask for records that are larger and smaller or equal to in the same relationship

          Therefore you will get the first related record ( based on relationship's sort order )

          • 2. Re: how to automatically read new record based on a relationship between two tables
            yodajing

            Sorry. Typo. The condition is like this.

             

            A::value1 > B::value2

            AND

            A::value1 <= B::value3

             

            One odd thing is that the field is updated when I update irrelevant field.

            I guess this comes from the relationship refresh trigger.

            Is there any point that affects the auto-update?

            • 3. Re: how to automatically read new record based on a relationship between two tables
              philmodjunk

              You need to describe what you are doing and have set up in more detail.

               

              Often, you need to commit records after changing the value of a match field. You can do this by clicking a blank area of your layout or via a script.

              • 4. Re: how to automatically read new record based on a relationship between two tables
                siplus

                yodajing wrote:

                 

                Two tables have a relationship based on following condition.

                 

                A::value1 > B::value2

                AND

                A::value1 <= B::value2

                 

                And I have one field, fieldA, of A, and that field is updated with the a field, fieldB, of B which is selected by above condition.

                 

                But, if I change the A::value1 to read another record, it does not automatically change the record.

                That is still showing the old one. So fieldA has the old value.

                 

                How could I make the app read the record based on updated condition?

                 

                read new record ? or automatically change the record ? the whole makes no sense.

                 

                pls break it down in steps and remove the abstraction you're enveloping the whole question with.

                 

                and remember that google translate doesn't, when it gets down to IT.

                • 5. Re: how to automatically read new record based on a relationship between two tables
                  yodajing

                  Thank you. BTW, how can I commit records? In my case, the subtotal value is changed after every new record.

                  And I want to look up a field value of new record based this changed subtotal.

                  But lookup operation returns old one, not the new record.

                  And weird thing happened when I change other fields.

                  When I change other fields, suddenly new record is read and lookup operations returns new one.

                  Any comments?

                  • 6. Re: how to automatically read new record based on a relationship between two tables
                    electon

                    How is this field defined then? Is it a lookup field, a stored calculation, an un-stored calculation?

                    Some explanation is needed. The fields that cause an update may be irrelevant but may not be as the whole record is involved.

                    • 7. Re: how to automatically read new record based on a relationship between two tables
                      philmodjunk

                      how can I commit records?

                       

                      As I previously stated, you can manually commit records by clicking a blank area of the layout. This is a simple way to test to see if committing records will cause things to update for you. It depends on exactly how you've set this up as to whether this will work or not.

                       

                      In a script, there's a step that explicitly commits records and it's called exactly that--> Commit Records. So if you find that clicking a blank area of the layout updates things the way you want, you can investigate setting up a script trigger that commits the records automatically. Which trigger to set up for this and on which object would require a much more detailed understanding of your layout design and how you set up this field which you've now indicated computes a "sub-total". There are several different ways to do that. An unstored calculation field using the Sum ( ) function defined in the parent table in order to sum values from the related child table--is often the method that updates with the least "help" from a script or manual action intended to force an update.