API EditRecord not working

  • 0
  • 2
  • Question
  • Updated 1 year ago
  • Answered
have url formula button on a report:

URLRoot()&"db/"& [_DBID_V2_0_COGS] &"?a=API_EditRecord&rid="&[Record ID#]&"&_fid_54"&URLEncode("Global Priority")& "&z=" & Rurl()


When I click it i get the following screen and it does not set the field to "Global Proirity" what am I missing?

Thanks for the help!



Photo of jeanne

jeanne

  • 374 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 2
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
>what am I missing?

missed a "=" sign after the fid_54.

&_fid_54="&URLEncode("Global Priority")& "
(Edited)
Photo of jeanne

jeanne

  • 374 Points 250 badge 2x thumb
Thank you so much! it is updating now, but the XML response it still popping up til i close , how do i get that to go away? thank you again!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,038 Points 50k badge 2x thumb
So when you use the API to do pretty much anything, unless you have them do something next, they feel compelled to report on their success (or failure).  So you need to have it land the user somewhere after clicking.

Here is one easy way.

Change the the API call to a formula variable and then do this crazy javascript refrsh thing.  Don't worry that you don't understand that code.  "Nobody does".  It just works to refresh the screen you are on.

var text URL = URLRoot()&"db/"& [_DBID_V2_0_COGS] &"?a=API_EditRecord&rid="&[Record ID#]&"&_fid_54="&URLEncode("Global Priority");


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

// remember to always end your formula variables with a semi colon.
// the $URL in that code above is referring to our formula variable name above.
Photo of jeanne

jeanne

  • 374 Points 250 badge 2x thumb
Thank you so much, that fixed it!