API EditRecord not working | Discussions

Expand all | Collapse all

API EditRecord not working

  • 1.  API EditRecord not working

    Posted 06-28-2017 20:30
    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!

  • 2.  RE: API EditRecord not working

    Posted 06-28-2017 20:34
    >what am I missing?

    missed a "=" sign after the fid_54.

    &_fid_54="&URLEncode("Global Priority")&

  • 3.  RE: API EditRecord not working

    Posted 06-29-2017 11:50
    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!

  • 4.  RE: API EditRecord not working

    Posted 06-29-2017 14:00
    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.

  • 5.  RE: API EditRecord not working

    Posted 06-29-2017 15:31
    Thank you so much, that fixed it!