10 Replies Latest reply on Jul 10, 2014 8:39 AM by philmodjunk

    Help with Go to Related Record Script

    AmberDavis

      Title

      Help with Go to Related Record Script

      Post

           Struggling a bit with a script that involves GTRR. My objective is to have truck serial #'s listed on a page (ShopOrderList) pulled from a manual entry field on ShopOrderForm (Where workers can enter an order for truck parts) and one can click a button and parts that have been ordered for this specific truck serial # will show in list form on a layout called (RelatedParts). I set the button to perform a script that:

           

                Set Variable [$$CurrentItemID; Value:Transactions::ItemID]

           

                Go to Related Record [Show only related records; From table:: "Inventory"; Using layout: "RelatedParts" (Inventory)]

           When I click the button it doesn't show all the parts for the serial number. What am I doing wrong? I can attach a picture of my relationships, maybe it has something to do with that since I struggle the most with making relationships.

      Screen_Shot_2014-07-09_at_3.34.49_PM.png

        • 1. Re: Help with Go to Related Record Script
          AmberDavis
          /files/add5ba672a/Screen_Shot_2014-07-09_at_3.46.48_PM.png 795x264
          • 2. Re: Help with Go to Related Record Script
            philmodjunk

                 On which of the above table occurrences is your ShopOrderForm based? ShopOrders?

                 If so, there is no direct relationship between that table occurrences and the Inventory Table occurrence--which is what you specifed as the "From table" setting in your Go To Related Records step.

                 I also do not see any field being used in your relationship match fields as the truck serial number field. Is Item ID the id for the part, the truck or both?

            • 3. Re: Help with Go to Related Record Script
              AmberDavis

                   ShopOrderForm is based under the table of PurchaseOrders. Should I change it to ShopOrders? And yes the ItemID is the ID for the PART. I set Serial# field under Purchase Orders and set it as a lookup under the field of Inventory. I don't think I have an ID for the actual truck

              • 4. Re: Help with Go to Related Record Script
                philmodjunk

                     PurchaseOrders should be a better option that shopOrders. I was guessing ShopOrders due to the similar names used.

                     But I am confused by:

                     

                          I don't think I have an ID for the actual truck

                     This appears to contradict:

                     

                          My objective is to have truck serial #'s listed on a page

                     What field in Purchase Orders Identifies the truck for which you are ordering parts?

                     And are you sure that you want to list records from Inventory and not Transactions?

                     It would seem a set of Transactions records, from all Purchase Order records that ordered parts for the specified truck, would list all "parts that have been ordered for this specific truck serial #".

                     A list of related Inventory records could list much the same information, but with one possibly crucial difference. If the same part has been ordered multiple times for a given truck, that part will appear multiple times in Transactions, but only once in Inventory.

                • 5. Re: Help with Go to Related Record Script
                  AmberDavis

                       Serial# in purchase orders will ideally identify the truck. Sorry for the confusion. And ok I never thought to use Transactions! That would make sense! And eventually I will make it so workers cannot duplicate part orders. I was thinking of writing a script that will search for duplicates and make it so they cannot complete the order. So do I connect ShopOrders (ItemID) to Transactions (ItemID) or should connect PurchaseOrders (ItemID) to Transactions (ItemID)? I feel like I created the ShopOrders table for no reason and it is not necessary.

                  • 6. Re: Help with Go to Related Record Script
                    philmodjunk

                         Yet workers may need to duplicate part orders. The same part can fail more than once....

                         If you were to set up a new occurrence of Purchase orders and a new occurrence of transactions like this:

                         Purchase Orders------<Purchase Orders|SameSerial------<Transactions|SameSerial

                         Purchase Orders::Serial# = Purchase Orders|SameSerial::Serial#

                         Purchase Orders|SameSerial::PO Number = Transactions|SameSerial::PO Number

                         then this GTRR script step would pull up a found set of all transactions records for PO's with the same value in the serial number field:

                         Go To Related Record [Show only related records; From table: Transactions|SameSerial ; Using layout: "Transactions" (Transactions) ]
                          

                    • 7. Re: Help with Go to Related Record Script
                      AmberDavis

                           You have a very good point about that! Perhaps I will put in an override option for instances such as that, Good thinking! And Im just a little confused. I made a table occurrence for PurchaseOrder (PurchaseOrders2) and Transactions (Transactions 3). I made a relationship between PurchaseOrders and PurchaseOrders2 (using Serial# to SameSerial) and I auto calculated PurchaseOrders SameSerial with Serial# and then I made a relationship between PurchaseOrders2 and Transactions 3 using PurchaseOrders2 (SameSerial) and Transactions3 (SameSerial) both with auto calculation of PO Number but I ran into a problem because I cannot auto calculate SameSerial again because it is under PurchaseOrders. Did I perhaps do something wrong or misread your directions?

                      • 8. Re: Help with Go to Related Record Script
                        AmberDavis

                             I tried to find one of your posts where you explain your "Lingo" and symbols but I couldn't find one. 

                        • 9. Re: Help with Go to Related Record Script
                          AmberDavis

                               As I thought long and hard while eating my Peanutbutter bagel I realized that PurchaseOrders|SameSerial Is just like my PurchaseOrders2. blush

                          • 10. Re: Help with Go to Related Record Script
                            philmodjunk

                                 Yep, but with a name that is more descriptive of it's intended function. wink