Forum Discussion

AlexBartholomew's avatar
AlexBartholomew
Qrew Member
7 days ago

API Button Help

Hello Everyone,

I have created an API button, but I keep getting an update_id error. Can someone please help me understand what this error means so I can fix it? Thank you -Bart

<qdbapi>

<action>API_AddRecord</action>

<errcode>0</errcode>

<errtext>No error</errtext>

<rid>26238</rid>

<update_id>1731629328550</update_id>

</qdbapi>

  • MarkShnier__You's avatar
    MarkShnier__You
    6 days ago

    You will probably do a Homer Simpson D'oh, but if you are pushing a button on the parent record then it's the [Record ID#] of the record you're sitting on that needs to be pushed into [Related Parent]

     

        "&_fid_15=" & URLEncode([Record ID#]) &

     

  • If a child is not connecting to a Parent, the double check the you are populating the correct fid for the related parent and that you are populating it with the correct value. 

    you can examine the result of the formula by exposing the code by removing the label for the button and then you can see what it is actually doing  

    • AlexBartholomew's avatar
      AlexBartholomew
      Qrew Member

      Hello Mark,

      So it is the connection from the parent table to the child. In the relationship, the Parent record ID on the child table is fid_15 which is the [Related Client], fid_18 is the [Client] name. Exposing the formula I'm getting either a 0 or (&_fid_15=&) or (&_fid_18&) into the next string.  

      The [Related Client] is the numeric reference in the relationship. Which I would think is the right field to use. That worked in my other API button. The fid's are on the child table. 

      I am on the parent table when clicking the button to populate on the child table. Does the order for fid's matter for API?

      If I hard code the Client's record ID # into fid_15, the call works perfectly. When I use [related client] the code says 0. 

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        You will probably do a Homer Simpson D'oh, but if you are pushing a button on the parent record then it's the [Record ID#] of the record you're sitting on that needs to be pushed into [Related Parent]

         

            "&_fid_15=" & URLEncode([Record ID#]) &

         

  • If you post your code and let us know where you want to land the user after they push the button then we can fix the code. This is not an error message it just means that you didn't land the user on a record or a report after the record was added. 

    Do you wanna land the user on the newly created record? Do you want to refresh the page that your lunch from? 

    • AlexBartholomew's avatar
      AlexBartholomew
      Qrew Member

      Hello Mark,

      I want to land back on the page I launched from. I also tried using the "&z=" & Rurl() which I thought would bring me back to the page I launched from. 

      URLRoot() & "db/" & [_DBID_INTERACTIONS] & "?a=API_AddRecord&apptoken=b5398xucxejay4cqkqm3ecnzy964" &
          "&_fid_15=" & URLEncode([Related Client]) &
          "&_fid_7=" & "Savings Credit" &
          "&_fid_6=" & Today() &
          "$_fid_53=" & [Completion Percentage PM] &
          "&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl())

      Thank you for your help.