Expand all | Collapse all

API Button help

  • 1.  API Button help

    Posted 13 days ago
    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?

    <errtext>No such record</errtext>
    <errdetail>Missing "rid" parameter.</errdetail>

    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#])


    Alex Bennett

  • 2.  RE: API Button help

    Posted 13 days ago
    The API for EditRecord only works to edit an existing record.
    If you want to pre-populate fields on an add record form, you can either set default values for those fields, or else I suggest making a form rule. 

    For example where a certain box is check (rule to fire only when that field changes)  then have 26 actions to set the values for fields.  I would only show that checkbox in add mode as you probably don't want to allow the users to accidentally change existing data entry values. 

    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach

  • 3.  RE: API Button help

    Posted 13 days ago
    I didn't think about using Dynamic Form Rules... lol 

    Thanks as always Mark!

    Alex Bennett

  • 4.  RE: API Button help

    Posted 12 days ago
    Another option would be to use api_GenAddRecordForm.  That will allow you to preset values into fields that are set as 'read-only' on the forms.

    Brad Lemke