Skip to main content
Question

Formula URL to generate new record on different table using specific form.

  • March 16, 2016
  • 0 replies
  • 232 views

Ok so I am trying to create a button that generates a new record in a different table while carrying over data from the existing table. I have other places that I have done this and I cannot seem to find where to get the ??????? from below. Does anyone have any advice? 


URLRoot() & "db/bj68rdvfx?a=API_GenAddRecordForm&_fid_???????" & URLEncode ([Record ID#])&"&dfid=10" & "&z=" & Rurl()

This topic has been closed for replies.

When you look at the target field ID and click on the Usage tab it will show you the field ID#.  Also on the field list of you click "options" towards the top right you can show the field ID# as well. Or right click on then field in the field list.

  • Author
  • Registered
  • March 16, 2016
Ok so I located the field ID but I guess I am still confused on which field ID to use....How do I determine what field ID to use because I put in a few different options and none of them work....

Perhaps if you explain in words what you are trying to do, I can help with specifics, but in general  the field ID is the one that you are trying to pre-populate on the Add Record form

  • Author
  • Registered
  • March 16, 2016
Someone from the customer service team got back to me on the support case and helped me answer my question. For context and completion of this thread I wanted to share what they helped me figure out...Just in case anyone else is looking for this answer. What I needed to get to was the related field between the two tables. I was trying to create a button that converted an applicant to an employee. To reduce data entry I wanted it to carry through the information, such as first name, last name, primary contact phone number, etc. I wanted those fields to come through so that I could write dynamic form rules to populate those fields automatically. Additionally I only needed a form on the employee table that had necessary fields so I created a form that was abbreviated. So the challenge was creating a Formula URL button that carried the information from the existing table to the new table and utilized the specific form that I had created. I accomplished this by locating the reference proxy field id and added to the formula that I put in my original post. Thus my formula above turned into this:

URLRoot() & "db/bj68rdvfx?a=API_GenAddRecordForm&_fid_133=" & URLEncode ([Record ID#])&"&dfid=10" & "&z=" & Rurl()

I did learn that this does not work without the = sign at the end of the fid. Not sure why but it is needed or it will not work. Hope this helps someone else out as much as it helped me!

Forum|alt.badge.img+6
  • Registered
  • September 4, 2017
What if I just want to change the 'Add New Record' form above a table in a parent record to start a New Record with a populated date? No need to open the record. 

Try this
URLRoot() & "db/" & [_DBID_the alias name of the table ] & "?a=API_GenAddRecordForm&_fid_xx="
& ToText([some date field])

Forum|alt.badge.img+6
  • Registered
  • September 4, 2017
The only field options are in the parent record. I'm not trying to pull the date from the parent record. I'm trying to create a new record with today's date in a field that's in the child record.

  • Registered
  • September 4, 2017
Use API_AddRecord, not GenAddRecordForm.

Then use the formula portion for the 
&_fid_xx="&URLEncode(Today())&"

If you want the date AND time use, 
&_fid_xx="&URLEncode(Now())&

Forum|alt.badge.img+6
  • Registered
  • September 4, 2017
I'm getting a Formula syntax error:
Expected a valid expression after the "&

  • Registered
  • September 4, 2017
You will still need the rest of the formula as well...

& URLEncode ([Record ID#])&"&dfid=10" & "&z=" & Rurl()

Forum|alt.badge.img+6
  • Registered
  • September 4, 2017
Can you show me what that looks like all together with the date and time field, because I'm getting an error that the parent record isn't found, and I don't speak code fluently :)

  • Registered
  • September 4, 2017
var text URL= URLRoot() & "db/" & [_DBID_CHILD_TABLE_ID] & "?a=API_AddRecord&_fid_yy="&URLEncode ([Record ID#])&"&apptoken=zzzzzzzzzzzz&_fid_xx="&URLEncode(Today());

"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);"


You will want to replace the "zzzzzzzzzz" with your app token,
change the fid_yy to the the field id of the [Related Parent] field on you child table.
 and the fid_xx with the field id number that you are looking to right the date to.

If you have trouble, copy your current equation from your "Add" button, and post it here (possibly as a new question because this one it getting long), and we can help you out.

Forum|alt.badge.img+6
  • Registered
  • September 4, 2017
Thanks so much Matthew! It worked, so I will end this string, and start a new one, because I do have another question. Thanks again!

Forum|alt.badge.img+6
  • Registered
  • September 4, 2017
One slight issue with this formula... the date is not populating, but I will include that in the next post.

Forum|alt.badge.img+6
  • Registered
  • September 4, 2017
One slight issue with this formula... the date is not populating, but I will include that in the next post.