BlakeJordan
8 years agoQrew Member
Combine API Edit button and API Add New Record Button into one button
I have two seperate buttons that each work just fine on their own. The first one edits the current record. And the second one adds a new child record in a related table. I would like to combine these two buttons into one button. Any ideas?
Button 1:
var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_485=" & URLEncode(User()) & "&_fid_486=" & URLEncode(Now()) & "&_fid_57=" & URLEncode("Left Daycare") & If([Change Roster Date?]="yes", "&_fid_203=" & URLEncode(Today()) & "&_fid_134=" & URLEncode("Yes"), null);
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
Button 2:
var text AddRecord =
URLRoot() & "db/" & [_DBID_ACTIVITIES]
& "?act=API_AddRecord&_fid_173=" & URLEncode ([Record ID#]) & "&_fid_181=" & URLEncode([Related Center]) & "&_fid_7=" & URLEncode("Roster Update") & "&_fid_10=" & URLEncode("left daycare " & [Name of Center]) & "&_fid_189=" & URLEncode("Removal Note");
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#];
$AddRecord
& "&rdr=" & URLEncode($DisplayRecord)
Any help is greatly appreciated! Thanks!
Button 1:
var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_485=" & URLEncode(User()) & "&_fid_486=" & URLEncode(Now()) & "&_fid_57=" & URLEncode("Left Daycare") & If([Change Roster Date?]="yes", "&_fid_203=" & URLEncode(Today()) & "&_fid_134=" & URLEncode("Yes"), null);
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
Button 2:
var text AddRecord =
URLRoot() & "db/" & [_DBID_ACTIVITIES]
& "?act=API_AddRecord&_fid_173=" & URLEncode ([Record ID#]) & "&_fid_181=" & URLEncode([Related Center]) & "&_fid_7=" & URLEncode("Roster Update") & "&_fid_10=" & URLEncode("left daycare " & [Name of Center]) & "&_fid_189=" & URLEncode("Removal Note");
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#];
$AddRecord
& "&rdr=" & URLEncode($DisplayRecord)
Any help is greatly appreciated! Thanks!