Skip to main content
Question

Creating a button that creates and populates a new record without opening the record

  • September 4, 2017
  • 0 replies
  • 30 views

Forum|alt.badge.img+6
Here is the code - with the help of Matthew Neil! However, the date is not populating into the record, and I would also like it to pull the name of the person identified in the parent record.


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);
This topic has been closed for replies.

  • Quickbase Alumni
  • September 4, 2017
Can you post "your" formula?  You can change the app token to zzzzzz, but please leave the rest of it as is.  Then I should be able to spot the error.

Forum|alt.badge.img+6
  • Author
  • Quickbase Alumni
  • September 4, 2017
Here you go... Also started a new thread.

var text URL= URLRoot() & "db/" & [_DBID_TIME_CLOCK] & "?a=API_AddRecord&_fid_6="&URLEncode ([Record ID#])&"&apptoken=d58b2yeetqfh3d7snhfjdjf7sv2&_fid_xx="&URLEncode(Today());

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

  • Quickbase Alumni
  • September 4, 2017
Ok, Don't feel bad, but....
in the portion of the formula after the app token where we are putting the "Today" function.

&apptoken=d58b2yeetqfh3d7snhfjdjf7sv2&_fid_xx="&URLEncode(Today());

You need to change the "xx" to be the field ID of your date field on the child table.  So if the date field is field id 12 your formula would look like:

&_fid_12="&URLEncode(Today());

Forum|alt.badge.img+6
  • Author
  • Quickbase Alumni
  • September 4, 2017
Oh, I should add... It works beautifully!

Forum|alt.badge.img+6
  • Author
  • Quickbase Alumni
  • September 4, 2017
Lol... I put that in the first ID field, which now explains why it wasn't going into the correct record. Thank you!