AlexBennett3
5 years agoQrew Trainee
API Button help
Hey Everyone,
I made a button on a form, that using an API_EditRecord Call, autofills 28 boxes with default numbers to save time. I'm having an issue getting this to work properly. When I change it to API_AddRecord, and Create a new form, I get an error that the record doesn't exist. This button only works if I create the form, skip clicking the button and click save and close. then go back in and edit, then clicking the button to autofill(after changing to API_EditRecord). Just wondering if anyone would have some advice on getting this to work?
------------------------------
Alex Bennett
------------------------------
I made a button on a form, that using an API_EditRecord Call, autofills 28 boxes with default numbers to save time. I'm having an issue getting this to work properly. When I change it to API_AddRecord, and Create a new form, I get an error that the record doesn't exist. This button only works if I create the form, skip clicking the button and click save and close. then go back in and edit, then clicking the button to autofill(after changing to API_EditRecord). Just wondering if anyone would have some advice on getting this to work?
<qdbapi>
<action>API_EditRecord</action>
<errcode>30</errcode>
<errtext>No such record</errtext>
<errdetail>Missing "rid" parameter.</errdetail>
</qdbapi>
Here is the API Call:
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=uw4jq7b9wmt6ybm59yqvc2dzpdj" &
"&_fid_53=2" &
"&_fid_60=3" &
"&_fid_67=2" &
"&_fid_74=1" &
"&_fid_54=2" &
"&_fid_61=3" &
"&_fid_68=2" &
"&_fid_75=1" &
"&_fid_55=2" &
"&_fid_62=3" &
"&_fid_69=2" &
"&_fid_76=1" &
"&_fid_56=2" &
"&_fid_63=3" &
"&_fid_70=2" &
"&_fid_77=1" &
"&_fid_57=2" &
"&_fid_64=3" &
"&_fid_71=2" &
"&_fid_78=1" &
"&_fid_58=2" &
"&_fid_65=3" &
"&_fid_72=2" &
"&_fid_79=1" &
"&_fid_59=2" &
"&_fid_66=3" &
"&_fid_73=2" &
"&_fid_80=1" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & Dbid() &
"?a=dr&rid=" & [Record ID#])
Thanks,
Here is the API Call:
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=uw4jq7b9wmt6ybm59yqvc2dzpdj" &
"&_fid_53=2" &
"&_fid_60=3" &
"&_fid_67=2" &
"&_fid_74=1" &
"&_fid_54=2" &
"&_fid_61=3" &
"&_fid_68=2" &
"&_fid_75=1" &
"&_fid_55=2" &
"&_fid_62=3" &
"&_fid_69=2" &
"&_fid_76=1" &
"&_fid_56=2" &
"&_fid_63=3" &
"&_fid_70=2" &
"&_fid_77=1" &
"&_fid_57=2" &
"&_fid_64=3" &
"&_fid_71=2" &
"&_fid_78=1" &
"&_fid_58=2" &
"&_fid_65=3" &
"&_fid_72=2" &
"&_fid_79=1" &
"&_fid_59=2" &
"&_fid_66=3" &
"&_fid_73=2" &
"&_fid_80=1" &
"&rdr=" &
URLEncode(URLRoot() & "db/" & Dbid() &
"?a=dr&rid=" & [Record ID#])
Thanks,
------------------------------
Alex Bennett
------------------------------