6 Replies Latest reply on Feb 27, 2013 12:33 PM by wardprobst

    ID Field does not display in related record

    wardprobst

      Title

      ID Field does not display in related record

      Post

           Howdy,

           I have a simple three table database. Table A has a Client ID that relates to Table B. Table B has an ID that relates to Table C. When I create a new client record in Table A, it is set to auto enter a new client id. When I create an new related record in Table B the id does not display in the field. I've tried various things but I can't seem to get the id to display in Table B. I'm having the same problem between table B and C. 

           Any ideas?

           Dale

        • 1. Re: ID Field does not display in related record
          philmodjunk

               And exactly what method are you using to "create a new related record"?

               The matching ID value will not automatically enter in the new record except under very specific circumstances.

               Example:

               If you enable "allow creation of records via this relationship" for Table B in the Table A to Table B relationship, you can set up a portal to Table B and when you enter data in the bottom "add" row of the portal, the Value of the current Table A::ClientID field is copied automatically into the matching ID field in Table B.

               If you just go to the layout for Table B and create a record, no value is automatically entered into it's ID field.

          • 2. Re: ID Field does not display in related record
            wardprobst

                 Made a script that goes: 

                 Freeze Window

                 New Window (Name: "Table B"; Style Floating Document)

                 New Record/Request

                 Go to Layout ["Table B" (Table B)]

                 Why is a portal necessary? The relationship is specified in the Relationship under Manage Database. The field is setup to show ID from Table A in layout of Table B?

                 Thanks,

                 Dale

            • 3. Re: ID Field does not display in related record
              philmodjunk

                   The portal is not necessary, but it's the most frequently used method for creating a related record without specifically entering the ID number from the parent record.

                   Your script can be modified to do the job:

                   Freeze Window
                   Set Variable [$ID ; TableA::CustomerID ]
                   New Window (Name: "Table B"; Style Floating Document)
                   Go to Layout ["Table B" (Table B)]
                   New Record/Request
                   Set Field [TableB::CustomerID ; $ID]

                   Note that you need to specify the layout before you create the new window record or you may be creating the record in the wrong table.

                    

              • 4. Re: ID Field does not display in related record
                wardprobst

                     Thank you, I understand that portals are useful, I was hoping to avoic them in this instance. 
                     I can replicate the script you sent with the exception of the last command. I can insert Set Field [TableB::CustomerID] but I cannot figure out how to add ;$ID to that in the manage script window. 

                     Your patience is appreciated,

                     Dale

                • 5. Re: ID Field does not display in related record
                  philmodjunk

                       When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                  • 6. Re: ID Field does not display in related record
                    wardprobst

                         Thank you very much that does what we need to do. I'll post another question under another subject line about phone numbers after I search and make sure there are no answers already here. 

                         Best regards,

                         Dale