IvanWeiss
4 years agoQrew Captain
API Edit Record, Mailto, and a rdr or nexturl?
Hi everyone,
I am trying to create a button via rich text field that will process an API call to update a record, open an email via a mailto, and redirect back to the record page I was on in one click. I understand there is no way to confirm the email was sent, but opening in the browser will be okay by me. Here is the code I have, which shows a white blank page after running. How do I continue the rdr back to the url? You can see I commented out code as it was not working:
var text baseurl = URLRoot() & "db/"& Dbid();
var text purchTbl = $baseurl & [_DBID_PURCHASE_ORDERS];
var text editRecord = "?a=API_EditRecord&apptoken=" & [EliteApptoken] & "&rid=" & [Record ID#];
var text LABEL = "Executive Approval";
var text decoration = "text-decoration: none;";
var text bgColor = "background: #0044cc;";
var text txtColor = "color: white;";
var text txtAlign = "text-align: center;";
var text txtShadow = "text-shadow: none;";
var text border = "border-radius: 5px;";
var text padding = "padding: 8px 20px;";
var text display = "display: inline-block;";
var text font = "font: normal 700 24px/1 'Calibri', sans-serif;";
var text styleOptns = List("", $decoration, $bgColor, $txtColor, $txtAlign, $txtShadow, $border, $padding, $display, $font);
var text mailto = "mailto:" & [Manufacturer - PO Submission Email] & "?subject=Purchase Order&body=Please review the attached Purchase Order and confirm receipt.";
If([Old PO], "",
If(IsNull([Executive Review On]) and IsNull([Project Review On]),
"<span style= 'font-family:Calibri;color:#57a3f0;font-size:14px'><Strong>Requires Executive Approval</Strong><br /></span>",
"<div><a style='" & $styleOptns & "' class='Vibrant' href='"
& $baseURL & $editRecord &
"&_fid_40=" & Today() & "&rdr=" &
URLEncode($mailto) &
//URLEncode("&rdr=" &
//URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]) &
"'>Submit PO</a></div>"))//)
------------------------------
Ivan Weiss
------------------------------
I am trying to create a button via rich text field that will process an API call to update a record, open an email via a mailto, and redirect back to the record page I was on in one click. I understand there is no way to confirm the email was sent, but opening in the browser will be okay by me. Here is the code I have, which shows a white blank page after running. How do I continue the rdr back to the url? You can see I commented out code as it was not working:
var text baseurl = URLRoot() & "db/"& Dbid();
var text purchTbl = $baseurl & [_DBID_PURCHASE_ORDERS];
var text editRecord = "?a=API_EditRecord&apptoken=" & [EliteApptoken] & "&rid=" & [Record ID#];
var text LABEL = "Executive Approval";
var text decoration = "text-decoration: none;";
var text bgColor = "background: #0044cc;";
var text txtColor = "color: white;";
var text txtAlign = "text-align: center;";
var text txtShadow = "text-shadow: none;";
var text border = "border-radius: 5px;";
var text padding = "padding: 8px 20px;";
var text display = "display: inline-block;";
var text font = "font: normal 700 24px/1 'Calibri', sans-serif;";
var text styleOptns = List("", $decoration, $bgColor, $txtColor, $txtAlign, $txtShadow, $border, $padding, $display, $font);
var text mailto = "mailto:" & [Manufacturer - PO Submission Email] & "?subject=Purchase Order&body=Please review the attached Purchase Order and confirm receipt.";
If([Old PO], "",
If(IsNull([Executive Review On]) and IsNull([Project Review On]),
"<span style= 'font-family:Calibri;color:#57a3f0;font-size:14px'><Strong>Requires Executive Approval</Strong><br /></span>",
"<div><a style='" & $styleOptns & "' class='Vibrant' href='"
& $baseURL & $editRecord &
"&_fid_40=" & Today() & "&rdr=" &
URLEncode($mailto) &
//URLEncode("&rdr=" &
//URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]) &
"'>Submit PO</a></div>"))//)
------------------------------
Ivan Weiss
------------------------------