Can you use a URL formula field to populate a related lookup field on a table

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
Can you give more details about what your tables are and how they are related and what you want to populate?
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
I am trying to trying to relate the child table to the parent table. I want a url button to create the relation when clicked.
below is the formula:
var text NewToggle = If([DSAC_SCH]=true, "0","1");
var text Site =[Related Order];

URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=cnfhq2kbqjb2edx6f7qwnu27xv&rid=" & [Record ID#]
& "&_fid_281="&$NewToggle& "&_fid_279="&$Site
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])

FID_279 is the lookup value and it is not working properly
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
Now I know what I need, I need the button to populate the child record id in the lookup value FID_279
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
I'm not really understanding.  A lookup field is not editable.  It gets its value by looking up a value in a parent table based on the field [related parent] being populated.

Are you trying to populate the field for [Related Parent]?  If so, what is the fid for that field?  Or are you saying that is what your fid 279 is.
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
I have a related table and I need to populate field 279 with the record ID from the child table to create the relationship link between the two
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
Is this button on a Parent table or a child table?
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
its on the parent, I am thinking I need to move it to the child
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
If you move the button to the child, how is it going to know what the record ID is of the parent.

I really think that you should step back from your technical question and explain in English the business purpose you are trying to accomplish, using the real names of the tables involved and what thy represent in real life.
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
I have two related tables the first table [Orders] have the status information and the second table need to get the status information, so I created a report link of all the orders in the first table that I need to track in the second table [Schedule] on the report link I want to create a button to fill in the lookup value in the Orders table. The lookup value is the record ID. How do I create a button to populate the record ID from a report link. I hope that is more clear
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
You say that you have a report link field on the Orders table which shows an embedded report of the schedule records for that order.  I guess those are line order lines.  Can you tell me what you are using on the report link field to get the correct schedule records to appear on the report link field?  What are the two fields on the Report link setup.
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
I have an order code that is on both the Order table and Schedule page but the order code can have child orders for example 4561-1, 4561-2,4561-3, so the report pulls in everything that begin with 4561 and the user will click the button if he want to schedule for any of 4561 orders
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
Can you tell me the field type of the Order code in the Orders table.  Is it numeric or text?, but meanwhile I will assume that it is a text field.

I suggest that you edit the field properties for the field [Related order] on the schedule table and make it a formula text field.  Then set the formula to be

Left([my schedule field with the hyphenated order code],"-")

That will remove everything after the hyphen and then all the child records will instantly link up with their parents.  Then  the lookup for the order status will populate down to the child records.
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
that was the first thing I tried, but that didn't work because the Orders primary key is record ID and Scheduler is record ID, so it didn't link the field was just populated with the order number
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
I suggest changing the Primary Key of the Orders table to the Order Code field