Field Dep_rev contain of
I only manage to using xpages JavaScript to send one user only.
method : maildoc.replaceItemValue("SendTo",document1.getItemValueString("Dep_rev"));
Below is my coding
var maildoc:NotesDocument = database.createDocument();
maildoc.replaceItemValue("Form", "Memo");
maildoc.replaceItemValue("Subject", "Testing mail");
session.setConvertMime(false);
var stream = session.createStream();
stream.writeText("<html><body>");
stream.writeText("<p>Testing</p>");
stream.writeText("</body></html>");
var body = maildoc.createMIMEEntity("Body");
body.setContentFromText(stream, "text/html;charset=UTF-8", 1725);
stream.close();
maildoc.closeMIMEEntities(true);
session.setConvertMime(true);
maildoc.replaceItemValue("SendTo",document1.getItemValueString("Dep_rev"));
maildoc.send();
Just use getItemValue:
maildoc.replaceItemValue("SendTo",document1.getItemValue("Dep_rev"));
As an alternative you can use copyItem:
maildoc.copyItem(document1.getDocument().getFirstItem("Dep_rev"), "SendTo");
Related
I am trying to send a forgot password mail through AWS SES service. I made this template
{
"Template":{
"TemplateName": "forgotpasswrd",
"SubjectPart": "Forgot password ",
"TextPart":"Text area",
"HtmlPart":"<p>We heard that you lost your password. Sorry about that!<\/p>\r\n <p>But don\u2019t worry! You can use the following link to reset your password:<\/p>\r\n <a href=${url}>${url}<\/a>\r\n <p>If you don\u2019t use this link within 1 hour, it will expire.<\/p>\r\n "
}
}
And this is my code in nodejs to input password reset link.
const params = {};
const destination = {
ToAddresses: [String(email)],
};
const templateData = {};
templateData.url = String(Url);
params.Source = 'myemailid#gmail.com';
params.Destination = destination;
params.Template = 'forgotpassword';
params.TemplateData = JSON.stringify(templateData);
In this Url is what i am trying to send.
However when I receive the mail its it does not show the link but only the html text
" But don’t worry! You can use the following link to reset your password:
${url}
If you don’t use this link within 1 hour, it will expire."
How do I send the link in the mail?
It should be {{url}}, not ${url}. See the documentation.
I recently installed a script that creates a Google __utmz cookie for my site visitors, and it sets all of the fields. Below is a look at it.
<script>
function get_campaign_info()
{
var utma = get_utm_value(document.cookie, '__utma=', ';');
var utmb = get_utm_value(document.cookie, '__utmb=', ';');
var utmc = get_utm_value(document.cookie, '__utmc=', ';');
var utmz = get_utm_value(document.cookie, '__utmz=', ';');
source = get_utm_value(utmz, 'utmcsr=', '|');
medium = get_utm_value(utmz, 'utmcmd=', '|');
term = get_utm_value(utmz, 'utmctr=', '|');
content = get_utm_value(utmz, 'utmcct=', '|');
campaign = get_utm_value(utmz, 'utmccn=', '|');
gclid = get_utm_value(utmz, 'utmgclid=', '|');
session_count = get_session_count(utma);
pageview_count = get_pageview_count(utmb, utmc);
if (gclid !="-") {
source = 'google';
medium = 'cpc';
}
}
</script>
Looking through my cookies I can see that it is being created. For example heres a bit of it:
"47664550.1486736628.2.2.utmcsr=website.com|utmccn=(referral)"
I have another script which is cleaning it all up and posting it to my console.
The issue that I am finding is that I can't figure out how to push those fields, like Campaign Medium, to hidden form fields on my site. Below is a look at how my typical Marketo form creates hidden fields with user data.
MktoForms2.whenReady(function(form){
ga(function(){
form.addHiddenFields({
GA_User_ID__c : ga.getByName('gtm1').get('userId')
});
});
Does anyone have an idea of how I can push medium, session, etc. to hidden fields? Thanks for any advice or just for reading! If it helps, the page I've been running tests on is powerreviews.com/form-test
For Marketo forms you should use the Marketo Form API. Go to this page and scroll down to the hidden field example.
In case the URL changes, here is the example code:
MktoForms2.loadForm("//app-sjst.marketo.com", "785-UHP-775", 1057, function (form) {
// Set values for the hidden fields, "userIsAwesome" and "enrollDate"
// Note that these fields were configured in the form editor as hidden fields already
form.vals({"userIsAwesome":"true", "enrollDate":"2014-01-01"});
});
My screen has a Telrik rad popup which populate on a button click(btnCourseDescription). I have taken a label to show html formated data and a textbox to work with code behind file. when I click on btnCourseDescription; Telrik's popup opens and and after submit it shows data on label and assign value to textbox using Javascript ... Here is my Javascript code...
<script type="text/javascript">
function clientShow(sender, eventArgs)
{
//$find();
var txtInput = document.getElementById("<%=lbCourseDescription.ClientID%>");
sender.argument = txtInput.innerHTML;
}
function clientClose(sender, args)
{
if (args.get_argument() != null)
{
var lbInput = document.getElementById("<%=lbCourseDescription.ClientID%>");
var txtInput = document.getElementById("<%=txCourseDescription.ClientID%>");
lbInput.innerHTML = args.get_argument();
txtInput.value = args.get_argument.htmlEncode();
}
}
</script>
Now when I click on btnCourseDescription and and assign value using popup data submits successfully but when I want to update any other field means I am not updating HTML formatted data, HARDERROR occurs:
A potentially dangerous Request.Form value was detected from the client (ctl00$cphMain$txCourseDescription="...ace="'MS Sans Serif&#...").
Please suggest me what should I do?
I am creating dynamic form in JavaScript. I want to send the data's from JavaScript to servlet. I dont use any submit Button in my Form.Using button only i want to send the data's. Anyone help me please.
This is my code:
var myform=document.createElement("form");
myform.setAttribute("id", "myform");
var tname=document.createElement('input');
tname.setAttribute('type','text');
tname.setAttribute('name', "name");
var leaveMessage=document.createElement('input');
leaveMessage.setAttribute('type','button');
leaveMessage.setAttribute('name', "msgButton");
leaveMessage.setAttribute('value', "Leave Message");
myform.appendChild(tname);
myform.appendChild(leaveMessage);
document.body.appendChild(myform);
add some statements also
var myform=document.createElement("form");
myform.setAttribute("id", "myform");
myform.setAttribute('action', "/mypage");
myform.setAttribute('method', "post");
var tname=document.createElement('input');
tname.setAttribute('type','text');
tname.setAttribute('name', "name");
var leaveMessage=document.createElement('input');
leaveMessage.setAttribute('type','button');
leaveMessage.setAttribute('name', "msgButton");
leaveMessage.setAttribute('value', "Leave Message");
myform.appendChild(tname);
myform.appendChild(leaveMessage);
document.body.appendChild(myform);
document.forms["myform"].submit();
Breaking my head against more compex problems, I try to get back to basics.
I want to have a jScript in a form, that upon user change in control Sub-Fund, will pop up a message showing the new value of that control.
Here is my code -- which returns an error, of course 8-(((
function TestForDummy()
{
var noind = crmForm.all.new_subfundid.DataValue;
alert(noind);
}
Whenever I update Sub-Fund, it gives me an error
Field:new_subfundid, Event:onchange, Error:Object expected
What'wrong ?
Try this :
function TestForDummy()
{
var lookupValue = Xrm.Page.getAttribute("new_subfundid").getValue();
var noind = lookupValue[0].id;
alert(noind);
}