• Jyothi Nimmakayala
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
When a contact attends seminars first time, an email should be sent . Same contact attending seminar within 60 days from intial email sent, no email needs to sent out. After 60 days , if same contact attended new seminar , send a new email. 
Seminar(Custom object) is a related list under contact . 
I think flow trigger/apex trigger is the way to go in comparing date of last email sent . But i am completely new to flow triggers. Can anyone please assist.
Fields avaliable in Seminar object 
Seminar_Status__c     Picklist
Contact__c                  Lookup(Contact)
Lead__c                       Lookup(Lead)

Criteria: Seminar Status= "Attended" and Contact<>NULL

Thank you 
I have a requirement to send email alert when seminar attendee(custom object) is selected as contact (look up object) and seminar status as "attended". But when same contact is selected for another seminar attendee and status as "attended", email should not be sent . Only after 30 days if new seminar attendee is selected for this contact , then new email alert should trigger. I was able to set up process builder for this seminar attendee object and send email alert but need logic for 30 day calculation before another new email can trigger.
Can someone please help
Below code is to generate new task and generate email alert when 'Is Eligible to Survey" formula field is true . But i am receiving error as TRUE is not defined . Can someone help please.

{!REQUIRESCRIPT('/soap/ajax/28.0/connection.js')} 
{!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")} 
if({!Contact.Is_Eligible_to_Survey__c} == "TRUE") 
try{ 
var newTask = new sforce.SObject('Task'); 
newTask.OwnerId = '{!$User.Id}'; 
newTask.Subject = 'Officevisit: Walk-In'; 
newTask.Status = 'Completed'; 
newTask.WhoId = '{!Contact.Id}'; 
if({!Contact.Language__c}=="English"){ 
var message = new sforce.SingleEmailMessage(); 

message.targetObjectId = "{!Contact.Id}"; 
message.toAddresses = "{!Contact.Email}"; 
message.templateId = "00X4C000000QvzM"; 

var result = sforce.connection.sendEmail([message]); 

else { 
({!Contact.Language__c}=="Spanish") 
var message = new sforce.SingleEmailMessage(); 

message.targetObjectId = "{!Contact.Id}"; 
message.toAddresses = "{!Contact.Email}"; 
message.templateId = "00X4C000000QvzM"; 


var result = sforce.connection.create([newTask]); 

var ContactToUpdate = new sforce.SObject("Contact"); 
ContactToUpdate.Id = "{!Contact.Id}"; 
ContactToUpdate.Survey_Sent_Date__c = new Date(); 
sforce.connection.update([ContactToUpdate]); 

window.location.reload(); 

if(result[0].success=='true'){ 
alert('The Task was created Successfully.'); 


else{ 
alert('An Error has Occurred. Error: Please Enter Language' + result); 


catch(e){ 
alert('An Un-expected Error has Occurred: Error: ' + e); 
}

Thank you
When a contact attends seminars first time, an email should be sent . Same contact attending seminar within 60 days from intial email sent, no email needs to sent out. After 60 days , if same contact attended new seminar , send a new email. 
Seminar(Custom object) is a related list under contact . 
I think flow trigger/apex trigger is the way to go in comparing date of last email sent . But i am completely new to flow triggers. Can anyone please assist.
Fields avaliable in Seminar object 
Seminar_Status__c     Picklist
Contact__c                  Lookup(Contact)
Lead__c                       Lookup(Lead)

Criteria: Seminar Status= "Attended" and Contact<>NULL

Thank you 
Below code is to generate new task and generate email alert when 'Is Eligible to Survey" formula field is true . But i am receiving error as TRUE is not defined . Can someone help please.

{!REQUIRESCRIPT('/soap/ajax/28.0/connection.js')} 
{!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")} 
if({!Contact.Is_Eligible_to_Survey__c} == "TRUE") 
try{ 
var newTask = new sforce.SObject('Task'); 
newTask.OwnerId = '{!$User.Id}'; 
newTask.Subject = 'Officevisit: Walk-In'; 
newTask.Status = 'Completed'; 
newTask.WhoId = '{!Contact.Id}'; 
if({!Contact.Language__c}=="English"){ 
var message = new sforce.SingleEmailMessage(); 

message.targetObjectId = "{!Contact.Id}"; 
message.toAddresses = "{!Contact.Email}"; 
message.templateId = "00X4C000000QvzM"; 

var result = sforce.connection.sendEmail([message]); 

else { 
({!Contact.Language__c}=="Spanish") 
var message = new sforce.SingleEmailMessage(); 

message.targetObjectId = "{!Contact.Id}"; 
message.toAddresses = "{!Contact.Email}"; 
message.templateId = "00X4C000000QvzM"; 


var result = sforce.connection.create([newTask]); 

var ContactToUpdate = new sforce.SObject("Contact"); 
ContactToUpdate.Id = "{!Contact.Id}"; 
ContactToUpdate.Survey_Sent_Date__c = new Date(); 
sforce.connection.update([ContactToUpdate]); 

window.location.reload(); 

if(result[0].success=='true'){ 
alert('The Task was created Successfully.'); 


else{ 
alert('An Error has Occurred. Error: Please Enter Language' + result); 


catch(e){ 
alert('An Un-expected Error has Occurred: Error: ' + e); 
}

Thank you