13 Replies Latest reply on Jun 21, 2010 12:46 PM by LaRetta_1

    Way to Go to Specific Item when Field is filled?

    LuisN

      Title

      Way to Go to Specific Item when Field is filled?

      Post

      Ok guys, heres one :)

       

      So i Have the field Product # and Ref #. Both of which live in 2 Different Tables in the same DB. 

       

      In my line items, i have an Arrow to the Left of Product and Ref #. There will be line items that have a Ref or a Product #, NEVER both.

       

      Clicking on this arrow, currently right now i have it just going to the Layout mode in that DB. thats all. but i'd like to refine it and make it so when clicking on the arrow, it goes to THAT specific Product using the Product item # OR going to the "Special Product" if the Product Item # field is blank and it finds somethings in the Ref # field it goes to the Special Product Layout and finds that specific Record. kinda stomped. thanks!

        • 1. Re: Way to Go to Specific Item when Field is filled?
          LaRetta_1

           Hi Luis,

           

          You must have a relationship from LineItems back to itself self-join as:

           

          LineItems::ProductID = LineItems_Products::ProductID

           

          and another relationship as:

           

          LineItems::ReferenceID = LineItems::References::ReferenceID

           

          ... and these are the relationships used in your script GTRR.

           

          Script might be something like this when clicking the arrow:

           

          Set Error Capture [ On ]

          If [ not IsEmpty ( Product# ) ]

          Go To Related Record [ show only related records (current record) from table LineItems_Products; using same or different layout ]

          Else

          Go To Related Record [ show only related records (current record) from table LineItems_References; using same or different layout ]

          End If

           

          • 2. Re: Way to Go to Specific Item when Field is filled?
            LuisN

            Thanks Laretta,

             

            i am not sure i understnd this part.

             

            using same or different layout ] .. do you mean thats part of the script, or this is where i choose the layout ? i am not near my fmp machine i will be soon to test

            • 3. Re: Way to Go to Specific Item when Field is filled?
              LaRetta_1

              Well, I originally responded and then deleted it thinking I misunderstood.  But I think I had it correct to begin with.  If you are in LineItems and want to go to another record in LineItems which has that ProductID then my relationships I explained will work.  If you INSTEAD want to go to a Products table then change what I said.

               

              If you were GTRRing to the same table (lineItems) then you could have stayed where you were (and that's what I meant about use same or different layout).  So let's walk through this again:

               

              If, from LineItems, you want to go to detail record of a Product (probably table called Products) if there is a ProductID ... or go to the detail record of a Reference (probably table called References) if there is a ReferenceID, then it would be:

               

              LineItems::ProductID = Products::ProductID

               

              and another relationship as:

               

              LineItems::ReferenceID = Refernces::ReferenceID

               

              ... and these are the relationships used in your script GTRR.

               

              Script might be something like this when clicking the arrow:

               

              Set Error Capture [ On ]

              If [ not IsEmpty ( Product# ) ]

              Go To Related Record [ show only related records (current record) from table Products; using layout based upon Products table]

              Else

              Go To Related Record [ show only related records (current record) from table References; using layout based upon References table ]

              End If

               

              For once, I should have trusted my original instinct, I think or I should not have answered until it was clear.

               

               

              • 4. Re: Way to Go to Specific Item when Field is filled?
                LuisN

                ohh no no..

                 

                i am in LineItems and i want to go to a specific record in a table in another DB. :)

                 

                so for ex IF the Product ID is filled in line items when clicking on the "Arrow" it takes me to the Specific record that has that product # in the field in the other DB.

                 

                also, i have that relationship setup already :)

                • 5. Re: Way to Go to Specific Item when Field is filled?
                  LaRetta_1

                  Cool!  Then you should be good to go using the script and Go To Related Record[] as I've outlined. :smileyhappy:

                  • 6. Re: Way to Go to Specific Item when Field is filled?
                    LuisN

                    but just to understand (again im not at the fmp machine)

                     

                    where in the script does it take the Product ID # or the Ref # and "finds" the record with the Field Product # or Ref #?

                    • 7. Re: Way to Go to Specific Item when Field is filled?
                      LaRetta_1

                      No prob ...

                       

                      If [ not IsEmpty ( Product# ) ]

                      Go To Related Record [ show only related records (current record) from table Products; using layout based upon Products table]

                      Else

                      Go To Related Record [ show only related records (current record) from table References; using layout based upon References table ]

                      End If

                       

                      This says in human-speak:

                       

                      If there is a Product#, go to the specific Product detail in the Products table

                      otherwise it means there is a Reference#, right?  So then go to the specific Reference# in the References table

                       

                      Or ... according to your request, it will "make it so when clicking on the arrow, it goes to THAT specific Product using the Product item # OR going to the "Special Product" if the Product Item # field is blank and it finds somethings in the Ref # field it goes to the Special Product Layout and finds that specific Record."

                       

                      Are we on same thinking?

                      • 8. Re: Way to Go to Specific Item when Field is filled?
                        LuisN

                        ok tried that code. didnt work =(

                         

                         

                        • 9. Re: Way to Go to Specific Item when Field is filled?
                          LaRetta_1

                          You have provided no information about what didn't work.   Please upload a picture of your graph where it shows these connections from LineItems to Products and then LineItems to References and expand the boxes so I can see the key fields.  It will also help to see your script.  And then give us a link to them here please.

                          • 10. Re: Way to Go to Specific Item when Field is filled?
                            LuisN

                             

                            np. see in the Lines Items from Proposal.. ull see the 2 tabels to the right.

                            • 11. Re: Way to Go to Specific Item when Field is filled?
                              LaRetta_1

                              Okay.  If you are standing in LineItems from Proposal and you are attempting to GTRR to the two tables shown, it should work as suggested.

                               

                              Please provide your script.

                              • 12. Re: Way to Go to Specific Item when Field is filled?
                                LuisN

                                yup, did that. not sure why its not working. put the same code u have.

                                • 13. Re: Way to Go to Specific Item when Field is filled?
                                  LaRetta_1

                                  I see no copy of your script nor the file.  There isn't much I can do.