I'm trying to have a button at the top of an add record form that when pressed will update a field (or maybe multiple fields) on that form. Since the form is used in "Add" mode, I don't have a record ID yet.
I just need to press the button and then FID#18 changes to "abc" and hopefully be able to do this without needing to save or redirect the record.
I feel like this is a stupid question but I just can't figure it out. Forgive me :)
But it sounds like you are not adding a child off a Parent.
What I suggest is that you simply make a Special Add button and put it on the form. You would use the API_AddRecord to do this.
So what would happen is that the user will click the regular Add Record button. Then if the user realizes immediately that they want to use a standard template type Add Record with certain fields filled in, they would press the special Add Record button on the form. If they are smart enough to do this immediately, then they will simply get a new add record form pop up in place of the empty form they had. QuickBase should not interfere as the record has not been dirtied yet, ie no data entry yet.
If they are not smart enough, then when they click that button it will tell them they have unsaved changes and they will have the option to abandon those changes - which is what they should have done if they were smarter, to starts with a pre-populated form.
The typical format of an Add Record API would be
URLRoot() & "db/" & dbid() & "?act=API_AddRecord"
& "&_fid_6=" & Urlencode ("some text here")
& "&_fid_7=" & Urlencode ("some text here")
& "&_fid_8=" & Urlencode ("some text here")
Does that help?
In english that says "and once you have added the record, Display record =true" which means land the user on the display mode of the record.
But there is no option to land the user in edit mode and not way to use &next URL to go into edit mode as we don't know the record ID#.