Skip to main content
Solved

An API(?) button to copy fields from the form, to other fields


ReneeHansen1
Forum|alt.badge.img+6

Hi, so I am having the user choose what type of employee they need to hire.
if they're hiring a contractor, they'll also have a choice to an a full time position to convert that contractor later in time. I'm thinking - if they want the contractor data (Department, Level, Role) the same for the Full time position - I'd like to to have them click a button "same for Full time position" that will push that data over to the new fields for the full time detail.  This would all be on the same record and form.
Thanks!

Best answer by MikeTamoush

This is the general code to create an API to edit the current record. This use a formula URL but you could use a formula Rich Text and create the button imagery yourself.

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &  "&rid=" & [Record ID#] &
    "&apptoken=xxxxxxxxxxxxxxxxxxxxxx" & //your app token here
    "&_fid_6=0" & //sets a checkbox field to false
    "&_fid_7=" & URLEncode([Field A]) & //sets field 7 to field A
    "&_fid_8=" & URLEncode([Field B]) & //sets field 8 to field B
    "&rdr=" &   URLEncode(URLRoot() & "db/" & Dbid() &  "?a=dr&rid=" & [Record ID#])) //Redirect anywhere, this is to the record that was edited

View original
This topic has been closed for replies.

Forum|alt.badge.img+20

This is the general code to create an API to edit the current record. This use a formula URL but you could use a formula Rich Text and create the button imagery yourself.

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &  "&rid=" & [Record ID#] &
    "&apptoken=xxxxxxxxxxxxxxxxxxxxxx" & //your app token here
    "&_fid_6=0" & //sets a checkbox field to false
    "&_fid_7=" & URLEncode([Field A]) & //sets field 7 to field A
    "&_fid_8=" & URLEncode([Field B]) & //sets field 8 to field B
    "&rdr=" &   URLEncode(URLRoot() & "db/" & Dbid() &  "?a=dr&rid=" & [Record ID#])) //Redirect anywhere, this is to the record that was edited