Discussions

Expand all | Collapse all

Button to send mail and update activity

  • 1.  Button to send mail and update activity

    Posted 10-31-2018 14:41
    I almost have a button working.  What I want to do is open an email to the contact and create an activity saying the email has been sent.  So far I have this:-


    var text URLONE = "MailTo:" & URLEncode([Email]);
    var text URLTWO = URLRoot() & "db/" & [_DBID_ACTIVITIES]
    & "?act=API_AddRecord&_fid_148=" & URLEncode([Record ID#])
    & "&apptoken=xxxxxxxxxxxxxxxxxxxxxxxxxx"
    & "&_fid_7=Email Sent"
    & "&_fid_142=" & ToFormattedText(Now(), "DDMMYYYYHHMMSS")
    & "&_fid_165=" & "Email Sent"
    & "&_fid_157=" & [Related Company];
    var text URLTHREE = URLRoot() & "db/" & [_DBID_CONTACTS] & "?a=dr&rid=" & URLEncode([Record ID#]);
    $URLONE
    & "&rdr="& URLEncode($URLTWO)
    & URLEncode("&rdr="& URLEncode($URLTHREE))

    So $URLONE opens the email, $URLTWO creates the new activity and $URLTHREE keeps the current (Contacts)  page open with the new activity showing through a relationship link.

    The email bit and the add record bit all work fine separately but I can't figure the code to get them working together.  The code like this just opens an email. 

    I think it's do with the code around this bit but I could be wrong.

    $URLONE
    & "&rdr="& URLEncode($URLTWO)
    & URLEncode("&rdr="& URLEncode($URLTHREE))

    Any help gratefully received. 




  • 2.  RE: Button to send mail and update activity

    Posted 10-31-2018 16:32
    This link should help, essentially you need to change around the order of the URLs so the mailto: fire last aka $URLTHREE

    https://community.quickbase.com/quickbase/topics/can-i-use-a-formula-url-button-to-create-an-email-u...



  • 3.  RE: Button to send mail and update activity

    Posted 10-31-2018 17:24
    Thank you for replying, I tried this, the differences being "a=q&qid=" which I'm really not sure what it does and enclosing the formula variables in <>, all I get is a really long web string in the browser. 

    var text URLONE = URLRoot() & "db/" & [_DBID_ACTIVITIES] 
    & "?a=API_AddRecord&_fid_148=" & URLEncode ([Record ID#])
    & "&_fid_157=" & [Related Company] 
    & "&_fid_7=Email Sent"
    & "&_fid_142=" & ToFormattedText(Now(), "DDMMYYYYHHMMSS")
    & "&apptoken=cwfcy7gdzqrsyncqbi2bn4u4kr";

    var text URLTWO = URLRoot() & "db/" & [_DBID_CONTACTS] & "?a=q&qid=1";

    var text URLTHREE = "mailto:"& URLEncode([Email]);

    "<a href=" &
    $URLONE 
    & "&rdr="& URLEncode($URLTWO) 
    & URLEncode("&rdr="& URLEncode($URLTHREE))
    & "></a>"

    Do you know what is meant to happen with the variables enclosed in <a href anchor? 

    : / 




  • 4.  RE: Button to send mail and update activity

    Posted 10-31-2018 18:05
    That was part of someone else's formula, I don't think you need that <a href anchor

    var text URLONE = URLRoot() & "db/" & [_DBID_ACTIVITIES] 
    & "?a=API_AddRecord&_fid_148=" & URLEncode ([Record ID#])
    & "&_fid_157=" & [Related Company] 
    & "&_fid_7=Email Sent"
    & "&_fid_142=" & ToFormattedText(Now(), "DDMMYYYYHHMMSS")
    & "&apptoken=cwfcy7gdzqrsyncqbi2bn4u4kr";

    var text URLTWO = URLRoot() & "db/" & [_DBID_CONTACTS] & "?a=q&qid=1";

    var text URLTHREE = "mailto:"& URLEncode([Email]);

    $URLONE 
    & "&rdr="& URLEncode($URLTWO) 
    & URLEncode("&rdr="& URLEncode($URLTHREE))


  • 5.  RE: Button to send mail and update activity

    Posted 11-05-2018 10:12
    Thank you again, It's almost there, I get the email opened and the activity updated but the QB takes me to a blank page with something like with the email included in the URL.  






  • 6.  RE: Button to send mail and update activity

    Posted 11-05-2018 10:44
    There's a bit of code in the link above which I don't fully understand.
    "a=q&qid = 153"
    To me this means "action = query and query ID = 153", but without knowing what qid=153 means I'm stuck, but this seems to be the bit that returns to the original page.  How do we store queries?  


  • 7.  RE: Button to send mail and update activity

    Posted 01-03-2019 22:14
    Sorry for the late response, been having issues logging into the forums at work.

    qid = report ID