Issue with creating an entry into a related table that has a lookup table.

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I have an Activities table linked to a Work Order billing table.  The Work Order Billing table has a lookup to an Inventory table.  I am trying to create a button with a formula URL that will create an entry in the Work Order Billing table from the Activities table with two data points.  The first is a numeric value from a field in the Activities table (the table with the button).  The second point is a text entry in the Work Order Billing table to a field that has a lookup to an Inventory table. I just want to type the value that will match.

Below is what I have so far.  All it does is direct me to another page that states that nothing is there and cannot understand the URL.

URLRoot() & " db/" &[_DBID_WORK_ORDER_BILLING]
& "?act=API_AddRecord&_fid_65=" & URLEncode([Record ID#])
& "&_fid_42=" & URLEncode("Data Upload")
& "&_fid_10=" & URLEncode([GB])
& "& apptoken=abcdefghijklmnop"
& URLEncode(URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#])

fid_65 is Work Order Billing id for the Related Activity.

Thank you in advance for your assistance.
Photo of Markus

Markus

  • 0 Points

Posted 4 years ago

  • 0
  • 1
URLRoot() & " db/" &[_DBID_WORK_ORDER_BILLING]
& "?act=API_AddRecord&_fid_65=" & URLEncode([Record ID#])
& "&_fid_42=" & URLEncode("Data Upload")
& "&_fid_10=" & URLEncode([GB])
& "& apptoken=abcdefghijklmnop"

& "&rdr="& URLEncode(URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#])

When you go to do the next action after Adding the record, you need to "Redirect". You need that &rdr=
Photo of Markus

Markus

  • 0 Points
Thank you for the quick response.  I made the change as indicated and still have the same result.  Where should I look next?
Can you post you current formula?
Photo of Markus

Markus

  • 0 Points
Here you go!

URLRoot() & " db/" &[_DBID_WORK_ORDER_BILLING]
& "?act=API_AddRecord&_fid_65=" & URLEncode([Record ID#])
& "&_fid_42=" & URLEncode("Data Upload")
& "&_fid_10=" & URLEncode([GB])
& "& apptoken=vzw7gybavnw43crji7b9ct5nn53"

& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#])
look here

URLRoot() & " db/" &[_DBID_WORK_ORDER_BILLING]

There is an extra space after that first "
Photo of Markus

Markus

  • 0 Points
Syntax, syntax, syntax.  Thank you.  I also found the space before the apptoken which was problematic.  Thank you for your assistance.

Another note. These made it work, bu there was a problem with populating fid_42.  When trying to populate fid_42, I had to go to the record reference of "Data Upload" which was 64.  After that it worked as expected.

Thank you again!