Forum Discussion
SteveDavidson
6 years agoQrew Cadet
I'm no pro with APIs either, but since you need to add info to the record that is generated, you could try to do the checkbox part first, followed by the GenAddRecord part, something like this:
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#] & If([Sent To Purchasing]=true, "&_fid_14=0", "&_fid_14=1")
& "&rdr="
&URLEncode(URLRoot() & "db/" & [_DBID_PARTS] & "?act=API_GenAddRecordForm"& "&_fid_19=" & URLEncode([CSE - Full Name])
& "&_fid_20=" & URLEncode([Part Name/Desc. (s)]& "\n\n" &[Tool Name/Desc.])
& "&_fid_6=" & URLEncode([Part Number(s)]& "\n\n" &[Tool Number] )
& "&_fid_32=" & URLEncode([Equipment Name / Desc.])
& "&_fid_21=" & URLEncode([FL Number / Equipment Number])
&"&z=" & Rurl())
The last line I *think* should return you to the page you started on.
Again, I'm no expert, and with APIs I typically have to play around a bit with them, but that could be the general idea.
Alternatively, could an automation fired off of the creation of a record on your Parts table that would go and then check the box be an option if the double-API call in a URL doesn't work?
Hopefully that's helpful!
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#] & If([Sent To Purchasing]=true, "&_fid_14=0", "&_fid_14=1")
& "&rdr="
&URLEncode(URLRoot() & "db/" & [_DBID_PARTS] & "?act=API_GenAddRecordForm"& "&_fid_19=" & URLEncode([CSE - Full Name])
& "&_fid_20=" & URLEncode([Part Name/Desc. (s)]& "\n\n" &[Tool Name/Desc.])
& "&_fid_6=" & URLEncode([Part Number(s)]& "\n\n" &[Tool Number] )
& "&_fid_32=" & URLEncode([Equipment Name / Desc.])
& "&_fid_21=" & URLEncode([FL Number / Equipment Number])
&"&z=" & Rurl())
The last line I *think* should return you to the page you started on.
Again, I'm no expert, and with APIs I typically have to play around a bit with them, but that could be the general idea.
Alternatively, could an automation fired off of the creation of a record on your Parts table that would go and then check the box be an option if the double-API call in a URL doesn't work?
Hopefully that's helpful!