Forum Discussion

DavyOu1's avatar
DavyOu1
Qrew Trainee
4 years ago

Combine URL buttons' api cals

Hi community,

I am building an ERP system and I need some help about combining api calls in one URL button.

As shown in the below screenshot, there are status notes and documents tabs in an opportunity record.

Also, at the bottom you can see a button of Convert to Sales Order, which can take a bunch of information from an opportunity to a sales order. But it cannot take related status notes and documents to the other table.


I would love to have, when I click on the Convert to Sales Order button, the related status notes and documents from the opportunity record will also be brought over to the new sales order record. 


Please be mindful that, opportunities, sales orders, status notes and documents are four different tables.

The relationship:
one opportunity to many sales orders;
one opportunity record to many status notes;
one opportunity record to many documents;
one sales order record to many status notes;
one sales order record to many documents.

URL for the Convert to Sales Order button:
URLRoot() & "db/" & [_DBID_SALES] & "?a=API_GenAddRecordForm&_fid_22=" & URLEncode ([Record ID#])&
"&_fid_20=" & URLEncode ([Related Customer])&
"&_fid_24=" & URLEncode ([Sales Representative])

URL to add document in the Opportunities table:
URLRoot() & "db/" & [_DBID_DOCUMENTS] & "?a=API_GenAddRecordForm&_fid_13=" & URLEncode ([Record ID#])&
"&z=" & Rurl()

URL to add document in the Sales Orders table:
URLRoot() & "db/" & [_DBID_DOCUMENTS] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])&
"&_fid_12=" & URLEncode ([Related Customer])&
"&z=" & Rurl()



------------------------------
Thank you for your help!

Davy Ou, Quantitative Financial analyst
Certified QuickBase Developer, Lifetime learner
https://www.linkedin.com/in/davyou/
------------------------------
  • You cannot do this with a URL button as the Newly created sales order does not yet exists so the Record ID# of he Sales opportunity is not known.

    But you do know the Record ID# of the Opportunity and that can be written to the sales order.

    Then tigger an Automation or a Pipeline to trigger when a sales Opportunity is created and the [Record ID# of Original Opportunity] is not blank, and the action will be to copy across those records.

    However there is not API to copy file attachments so for those I suggest just using a Report link field on the Sales Order to display the Documents as an embedded table on the form.

    In fact, you could simply this 90% by not bothering to copy these across at all, but just show the respective Report Links embedded on he Sales Orders for matching to the the [Record ID# of Original Opportunity]


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • DavyOu1's avatar
      DavyOu1
      Qrew Trainee
      This is exactly what I am looking for. Thank you Mark!

      I overcomplicated it and thank you for simplify it for me!

      ------------------------------
      Davy Ou
      ------------------------------