Forum Discussion
EvanMartinez
8 years agoModerator
Hi Chad,
Typically for a button that edits a record and then saves those changes you would want to use the API Edit Record call within your button. The syntax of that would look something like below
URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=API_EditRecord&rid=" & URLEncode([Route ID#])&[Record ID#]&"&apptoken=xxxxxxxxxxxxx
&_fid_21=1
&_fid_15= "Marked for Review"
What this basic format does is calls the API_EditRecord call and using the Route ID# to fill in the rid and then for each field you want to change you need to include &_fid_(field id here)=(Value to be written). So in my example it is marking field 21 as true and making fid 15 equal to Marked for Review. Then you could include any redirect behavior you wanted to see to finish out the button. You would also just need to include an App Token for the application that you are looking to make the changes in.
Alternatively, if you just want to open up the record to be edited by a user and just auto populate a few values you would replace API_EditRecord with the call er (Edit Record Form).
URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=er&dfid=2&rid="& URLEncode([Route ID#])&[Record ID#]&"
&_fid_21=1
&_fid_15= "Marked for Review"
This will open the form to be edited and saved by the user with those fields pre populated for them. It just depends on which step you want to automate.
Typically for a button that edits a record and then saves those changes you would want to use the API Edit Record call within your button. The syntax of that would look something like below
URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=API_EditRecord&rid=" & URLEncode([Route ID#])&[Record ID#]&"&apptoken=xxxxxxxxxxxxx
&_fid_21=1
&_fid_15= "Marked for Review"
What this basic format does is calls the API_EditRecord call and using the Route ID# to fill in the rid and then for each field you want to change you need to include &_fid_(field id here)=(Value to be written). So in my example it is marking field 21 as true and making fid 15 equal to Marked for Review. Then you could include any redirect behavior you wanted to see to finish out the button. You would also just need to include an App Token for the application that you are looking to make the changes in.
Alternatively, if you just want to open up the record to be edited by a user and just auto populate a few values you would replace API_EditRecord with the call er (Edit Record Form).
URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=er&dfid=2&rid="& URLEncode([Route ID#])&[Record ID#]&"
&_fid_21=1
&_fid_15= "Marked for Review"
This will open the form to be edited and saved by the user with those fields pre populated for them. It just depends on which step you want to automate.