Forum Discussion
QuickBaseJunkie
Qrew Legend
7 years agoThe code below will create a child record in the background (while populating two fields), then return to the current record in edit mode, followed by a refresh of the page. You'll just need to plug in your app specific values.
var text URLONE = URLRoot() & "db/" & [_DBID_CHILD_TABLE] &
"?a=API_AddRecord" &
"&_fid_6=FieldA" &
"&_fid_7=07/28/2018" &
"&_fid_8=" & [Record ID#];
var text URLTWO = URLEncode( URLRoot() & "db/" & Dbid() &
"?a=er&rid="& [Record ID#] );
"javascript:" &
"$.get('" &
$URLONE & "&rdr=" & $URLTWO &
"',function(){" &
"location.reload(true);" &
"});"
var text URLONE = URLRoot() & "db/" & [_DBID_CHILD_TABLE] &
"?a=API_AddRecord" &
"&_fid_6=FieldA" &
"&_fid_7=07/28/2018" &
"&_fid_8=" & [Record ID#];
var text URLTWO = URLEncode( URLRoot() & "db/" & Dbid() &
"?a=er&rid="& [Record ID#] );
"javascript:" &
"$.get('" &
$URLONE & "&rdr=" & $URLTWO &
"',function(){" &
"location.reload(true);" &
"});"
ForrestParker
7 years agoQrew Cadet
Thanks for the response Quick Base Junkie.
However, I don't want to just create a record, I need the following sequence:
The reason I need the parent record refreshed is because the child record count needs to be updated. If not, the user adds the child record and is then presented with a child record count of zero; even though one has been saved. This can be confusing and cause duplicate entries.
See screenshot below to see the green plus button that I am referring to.
However, I don't want to just create a record, I need the following sequence:
- User clicks the formula URL within the the parent record
- the child record form opens
- The user fills in the details about the child record and clicks save
- the user is returned to the parent parent record where he/she started and the record is refreshed (specifically the child record count)
The reason I need the parent record refreshed is because the child record count needs to be updated. If not, the user adds the child record and is then presented with a child record count of zero; even though one has been saved. This can be confusing and cause duplicate entries.
See screenshot below to see the green plus button that I am referring to.