Forum Discussion

jeannejeanne's avatar
jeannejeanne
Qrew Cadet
7 years ago

API EditRecord not working

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!



4 Replies

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    >what am I missing?

    missed a "=" sign after the fid_54.

    &_fid_54="&URLEncode("Global Priority")&
  • 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!
  • 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.