JackFretwell
7 years agoQrew Assistant Captain
Button to send mail and update activity
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.
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.