Skip to main content
Question

API_EditRecord is not working

  • Jun 28, 2018 10:59 PM UTC
  • 0 replies
  • 39 views

What is wrong here with this URL Formula?

-----------------------------------------------------------------------------


var text NewToggle = If([Active]="Yes","No","Yes");


var text URL = URLRoot() & "db/" & Dbid()  & "?act=API_EditRecord&rid=" & [Userid]
& "&_fid_20=" & $NewToggle;




"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);"

---------------------------------------------------------------------------------

The Record ID of this table is "Userid"

https://www.screencast.com/t/Mh85B1N2

 
This topic has been closed for replies.

Forum|alt.badge.img+14
  • Qrew Corporal
  • Jun 28, 2018 11:06 PM UTC
Replace your &rid= with &key=
The [Record ID#] field ID# 3 never changes (even if you change the name).  Your key field can change; and that's when you have to reference the Key instead of the RID in your formula.

  • Author
  • Qrew Corporal
  • Jun 28, 2018 11:10 PM UTC
Thanks for helping me


Still not working 

var text NewToggle = If([Active]="Yes","No","Yes");


var text URL = URLRoot() & "db/" & Dbid()  & "?act=API_EditRecord&key=" &[Record ID#]
& "&_fid_20=" & $NewToggle;




"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);