Discussions

  • 1.  Make a button generate a quick note

    Posted 11-03-2021 17:03

    Hello,

    I've made a field called CALL BUTTON (Showing as Called) as a formula - URL

    This button is intended to add a note to a notes field called "Call Log". The note will be timestamped and label it as:

    "[Timestamp, User] Call made"

    Can someone support me with the appropriate input? Thank You




    ------------------------------
    Anthony Wong
    ------------------------------



  • 2.  RE: Make a button generate a quick note

    Posted 30 days ago
    It sounds like you can use the EditRecord API

    Assuming the field id of the notes field is 6:
    https://target_domain/db/target_dbid?a=API_EditRecord&rid=[rid of record to update]&_fid_6=[value to input]&apptoken=app_token&rdr=[url to redirect to after updating]

    ------------------------------
    Ahuva Brown
    ------------------------------



  • 3.  RE: Make a button generate a quick note

    Posted 30 days ago
    Sounds like you just need a simple API_EditRecord.
    Also, you need to activate the "log entries" option on the property of the field so it would keep track of who/when as well. 

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=apptoken" &
    "&_fid_id=Completed" &
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() &"?a=dr&rid=" & [Record ID#])

    Replace the the values in bold with 1) app token 2) field id of your notes field
    Hope this helps. 



    ------------------------------
    Francesco Spiga
    ------------------------------



  • 4.  RE: Make a button generate a quick note

    Posted 30 days ago

    Hello,

    Thank you for your swift response!

    I added the URL and changed app token to : Called

    and the ID to 10 since my multi text field is in slot 10 of the table.

    It's still giving me an error message. Am I missing something or mistaken an action step?

    Thank you again for the support.



    ------------------------------
    Anthony Wong
    ------------------------------



  • 5.  RE: Make a button generate a quick note

    Posted 30 days ago
    Can you post your url and error message?

    ------------------------------
    Ahuva Brown
    ------------------------------



  • 6.  RE: Make a button generate a quick note

    Posted 22 days ago

    Hello,

    Here is the error message:

    Please note, Field ID 9 is no longer customer address. It's a multi text field called Contact Log.

    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <qdbapi>
    <action>API_EditRecord</action>
    <errcode>34</errcode>
    <errtext>You cannot change the value of this field</errtext>
    <errdetail>The field named "Customer - Address" with field id 9 cannot be modified</errdetail>
    <rid>111</rid>
    <num_fields_changed>0</num_fields_changed>
    <update_id/>
    </qdbapi>

    ----------------------------------------------
    Here's the URL I put for the button:

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=Called Customer" &
    "&_fid_9=Completed" &
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() &"?a=dr&rid=" & [Record ID#])




    Thank You again for the support


    ------------------------------
    Anthony Wong
    ------------------------------



  • 7.  RE: Make a button generate a quick note

    Posted 22 days ago
    I also tried your link, but it wouldn't allow me to complete it due to the colon and a few other items I tried switching it out with. Here's a screenshot for your reference Ahuva.

    Thank You again for your help.



    ------------------------------
    Anthony Wong
    ------------------------------



  • 8.  RE: Make a button generate a quick note

    Posted 19 days ago
    Hi Anthony,

    Regarding the error message you received, it looks like the field you're trying to update (field ID 9) is not an editable field. Is it a formula field or a lookup field from another table? If so, it cannot be updated. To update a field with 'completed', it would need to be a regular text field.

    Is this the url you're using?

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=Called Customer" &
    "&_fid_9=Completed" &
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() &"?a=dr&rid=" & [Record ID#])

    (the sample I gave you was just a condensed version of that with fake data, so you can disregard it and use this one)

    The only problem I see with the url is that apptoken should be a long string of numbers and letters (for example: f4d85hg3dh693hf9dg6), and not 'called customer'. You can retrieve an apptoken by going to:
    app settings -> app properties -> security options -> manage application tokens. If there are no application tokens yet, you can create a new one there and copy/paste it to the url. Is there another field you're trying to update with the value 'called customer'?

    Aside from that, your url looks fine, so you just need to address the issue with field 9.

    ------------------------------
    Ahuva Brown
    ------------------------------



  • 9.  RE: Make a button generate a quick note

    Posted 19 days ago
    Ahuva,

    Thank you so much for pointing that out. I realized that the Field ID was in reference to it's origin, not where it's placed on my table. 

    I also generated an APP token and it's worked wonderfully. My only inquiry regarding the App token is what are they used for? Just the action for that particular button? Does it associate my user login to the action? This is my first time ever using one or making one.

    I sincerely appreciate the help from everyone here, I'm happy to know I'm not alone in researching how to further build my system. Thank you again everyone, the community is amazing.

    ------------------------------
    Anthony Wong
    ------------------------------



  • 10.  RE: Make a button generate a quick note

    Posted 19 days ago
    App tokens are associated with the app, not the user (there are user tokens as well but they're not used in API calls like this), and they're used as a layer of security to prevent unauthorized people from making changes to your app via API call. I suppose in theory anyone could get ahold of your domain and table id, but they wouldn't be able to access the application token unless they got into your settings. You don't necessarily need to use them - only if Require Application Tokens is checked in your settings.

    ------------------------------
    Ahuva Brown
    ------------------------------