Discussions

Expand all | Collapse all

Click a button in email notification to change field in different table

QuickBaseCoach Dev./Training07-27-2017 21:08

QuickBaseCoach Dev./Training07-28-2017 02:44

QuickBaseCoach Dev./Training07-28-2017 11:00

Quinten Quinten07-29-2017 18:35

  • 1.  Click a button in email notification to change field in different table

    Posted 07-27-2017 21:00
    I would like to have a button in an email notification that checks a box when clicked. However the email notification is located in a different table from that of the checkbox.

    I am getting error codes when clicking the button. I have made buttons before but error codes keep showing up. 


  • 2.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 21:08
    Please post you code for the button and the error


  • 3.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 21:13
    URLRoot() & "db/" & [_DBID_Contracts] & "?act=API_EditRecord&rid=" & [SAP Contract #]

    & "&apptoken=b9pzvpjdbfk42zck9xawjk99nx5"

    & "&usertoken=b27z4b_xfm_b57dsvw279ijqcf93f6cdaj7y4f"

    & "&_fid_282=true"


    ERROR Code:
    <qdbapi><action>API_EditRecord</action>
    <errcode>30</errcode>
    <errtext>No such record</errtext>
    <errdetail>
    Sorry, there is no record in this application table with the record identifier (rid) of "800275310".
    </errdetail>
    </qdbapi>


  • 4.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 21:22
    To edit a record you need to specify the record I'd or the key field value.


    There is no way that you have a Record ID of 800 million. So either you need to change to this


    &rid=" & [Record ID#]


    Or else


    &key=" & [SAP Contract #]


    If that SAP Contract was the Key field.


  • 5.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 21:29
    I changed it to &rid="& [Record ID#] and got the error:
    Sorry, there is no record in this application table with the record identifier (rid) of "5


  • 6.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 21:42
    The button is on table A. But you want to edit a record on another table, table B. Which record do you want to edit? You need to specify either the record ID number or the Key field of table B.

    Once that works you will then have to decide where you want to leave the user or else the system will put up a success message in the screen which you will want to suppress.


  • 7.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 21:44
    I want to edit table B. The Key field for both of the tables is the Record ID#. 


  • 8.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 22:09
    There are lots of records in table B. Which one do you want to edit.


  • 9.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 22:19
    the contract number was pulled in from the table B to table A (where the button is). I want to edit the record with that contract number. 


  • 10.  RE: Click a button in email notification to change field in different table

    Posted 07-27-2017 22:42
    You can only edit a record if you know the Key field or the Record ID. You would need to be willing to change the Key field in stable B to be the SAP #.


  • 11.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 02:15
    So I was able to get the checkbox to work (I just pulled over the record ID# from table B instead of changing the key field). EXCEPT, I get an ugly error message when I click the button. The error message is:
    <qdbapi>
    <action>API_EditRecord</action>
    <errcode>0</errcode>
    <errtext>No error</errtext>
    <rid>1991</rid>
    <num_fields_changed>1</num_fields_changed>
    <update_id>1501208116824</update_id>
    </qdbapi>


  • 12.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 02:41
    I fixed the error message, except when the button is clicked in the email, it takes me to the table A (where the button is located). I want it to take me to table B where the checkbox is located.


  • 13.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 02:44
    Can you post your current code?


  • 14.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 02:55
    URLRoot() & "db/" & [_DBID_Contracts] & "?act=API_EditRecord&rid=" & [Contract - Record ID#]

    & "&apptoken=b9pzvpjdbfk42zck9xawjk99nx5"

    & "&usertoken=b27z4b_xfm_b57dsvw279ijqcf93f6cdaj7y4f"

    & "&_fid_282=true"

    & "&rdr=" & URLEncode(URLRoot() & Dbid() "?a=dr&rid=" & [Record ID#])

    I'm thinking it is in the Dbid() part


  • 15.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 03:20
    Right. You want to land on the SAP table


    So the ReDiRect needs to say


    & "&rdr=" & URLEncode(URLRoot() & [_DBID_SAP_Table] & "?a=dr&rid=" & [Contract -Record ID#]


    You will need to get the correct name for that SAP table from settings, for that table, and then Advanced Properties.


  • 16.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 03:34
    I get an error code of 83 when I put it in the email notification.


  • 17.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 11:00
    Please post your current formula and the XML response


  • 18.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 12:36
    URLRoot() & "db/" & [_DBID_Contracts] & "?act=API_EditRecord&rid=" & [Contract - Record ID#]

    & "&apptoken=b9pzvpjdbfk42zck9xawjk99nx5"

    & "&usertoken=b27z4b_xfm_b57dsvw279ijqcf93f6cdaj7y4f"

    & "&_fid_282=true"

    & "&rdr=" & URLEncode(URLRoot() & [_DBID_Contracts] & "?a=dr&rid=" & [Record ID#])


    ERROR CODE:
    <?xml version="1.0"?>

    -<qdbapi>

    <action>API_EditRecord</action>

    <errcode>83</errcode>

    <errtext>Invalid error code: 83</errtext>

    <errdetail>User token is invalid</errdetail>

    </qdbapi>


  • 19.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 15:59
    It does not seem Tom like your usertoken. Is the usertoken enabled for the application which holds the record you are editing?


  • 20.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 16:55
    It is in the manage application tokens table within the App Properties. I'm not sure how to enable it though


  • 21.  RE: Click a button in email notification to change field in different table

    Posted 07-28-2017 19:06
    The user tokens are different than an application token.

    The user token allows a formula URL button to edit a record without the user needing to sign in.  The downside is that you will not know who actually clicked the button as it will always show the user of who owns the application token as the [Last Modified by]


    The user tokens are obtained by clicking on your name at the top right and then "Manage Preference".  That is where you can create user tokens and assign their use to specific apps.

    My guess is that the user token is either not correct or is not enabled for the app you are editing.


  • 22.  RE: Click a button in email notification to change field in different table

    Posted 07-29-2017 14:21
    Sorry for the problems. This worked, the checkbox gets checked when clicked in the email notification, however I now get the error "We can't understand the URL you specified. If you think the URL is correct, try refreshing this page." Not sure how to get rid of this error


  • 23.  RE: Click a button in email notification to change field in different table

    Posted 07-29-2017 14:47
    I can't read your mind as to what your current formula is.
    I'm good, but not clairvoyant.


  • 24.  RE: Click a button in email notification to change field in different table

    Posted 07-29-2017 14:59
    It is the same as above, I just put the user token in my preferences:

    URLRoot() & "db/" & [_DBID_Contracts] & "?act=API_EditRecord&rid=" & [Contract - Record ID#]

    & "&apptoken=*******************"

    & "&usertoken=*****************"

    & "&_fid_282=true"

    & "&rdr=" & URLEncode(URLRoot() & [_DBID_Contracts] & "?a=dr&rid=" & [Record ID#]


  • 25.  RE: Click a button in email notification to change field in different table

    Posted 07-29-2017 16:06
    Missung db/

    & "&rdr=" & URLEncode(URLRoot() & "db/" & [_DBID_Contracts] & "?a=dr&rid=" & [Record ID#


  • 26.  RE: Click a button in email notification to change field in different table

    Posted 07-29-2017 18:35
    It worked! Thanks so much!