• Hasmik
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi,
Our client has the following requirement: send mass emails to Custom Service Participants(child) object using predefined templates. Most of the info on the template is from the Service Schedule(parent).
To do this:
  1. I have created Classic templates with the respective merge fields, hyperlinks, and pictures.
  2. Created Email alert for Service Participant(child) using the template
  3. Created Flow using the email alert action to send the email to participants for whom Send Email (custom field) is set to Yes.
The merge fields for the Service Participants(child) that I use in the email template are coming, however, the merge fields for the Service Schedule(parent) are blank.
Can anyone tell me how to change email templates so that the parent fields are not blank too? 
Or let me know if there is a better solution for these requirements?
The idea is that, without being too technical, they should be able to send emails to a list of Service Participants(child) similar to Contacts.
Hi, I'm new to Apex and I'm not that good at it yet. I created an Appex Trigger on my sandbox and i need to deploy it but I can't do it without test code coverage. I don't really understand how that works, so can someone help me with the test code for the trigger bellow?

trigger UpdateScheduleOnInsertOrUpdate on pmdm__ServiceSession__c (after insert, after update) {
    set<Id> lstId = new set<Id>();
    string details = '';
    string sessionurl = '';
    for(pmdm__ServiceSession__c Con :trigger.new){
        lstId.add(Con.pmdm__ServiceSchedule__c);
    }
    list<pmdm__ServiceSchedule__c> lstAcc = 
        [select id, Meeting_URL__c, Session_Details__c From pmdm__ServiceSchedule__c Where Id IN :lstId];
    for(pmdm__ServiceSchedule__c Acc :lstAcc){
        sessionurl = Acc.Meeting_URL__c;
    }
    list<pmdm__ServiceSession__c> session = 
        [select Session_Details__c,pmdm__ServiceSchedule__c,pmdm__SessionStart__c From pmdm__ServiceSession__c 
         Where pmdm__ServiceSchedule__c IN :lstId ORDER BY pmdm__SessionStart__c];
    for(pmdm__ServiceSession__c Ses :session){
        details += Ses.Session_Details__c + '\n' + sessionurl + '\n';
    }
    
    for(pmdm__ServiceSchedule__c Acc :lstAcc){
        Acc.Session_Details__c = details;
    }
    update lstAcc;   
}
Hi, 
I'm new to Salesforce and i need to send email alerts to all selected Custom Object email adresses from list view. I created a Button that will run a flow that send email alert but i have an issue. The email alert should be selected by the user before sending it to the email adresses but in flows I need to manually select the alert template when i create the alert. Is it possible to create alerts based on templates specified by user with flow screen? 
Hi, I'm new to Apex and I'm not that good at it yet. I created an Appex Trigger on my sandbox and i need to deploy it but I can't do it without test code coverage. I don't really understand how that works, so can someone help me with the test code for the trigger bellow?

trigger UpdateScheduleOnInsertOrUpdate on pmdm__ServiceSession__c (after insert, after update) {
    set<Id> lstId = new set<Id>();
    string details = '';
    string sessionurl = '';
    for(pmdm__ServiceSession__c Con :trigger.new){
        lstId.add(Con.pmdm__ServiceSchedule__c);
    }
    list<pmdm__ServiceSchedule__c> lstAcc = 
        [select id, Meeting_URL__c, Session_Details__c From pmdm__ServiceSchedule__c Where Id IN :lstId];
    for(pmdm__ServiceSchedule__c Acc :lstAcc){
        sessionurl = Acc.Meeting_URL__c;
    }
    list<pmdm__ServiceSession__c> session = 
        [select Session_Details__c,pmdm__ServiceSchedule__c,pmdm__SessionStart__c From pmdm__ServiceSession__c 
         Where pmdm__ServiceSchedule__c IN :lstId ORDER BY pmdm__SessionStart__c];
    for(pmdm__ServiceSession__c Ses :session){
        details += Ses.Session_Details__c + '\n' + sessionurl + '\n';
    }
    
    for(pmdm__ServiceSchedule__c Acc :lstAcc){
        Acc.Session_Details__c = details;
    }
    update lstAcc;   
}