• Rebecca Pitts
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
Please email me if you are avaiable this week or next week. rebecca@rainsoftse.com
I am wondering if anyone knows when lightning components will be able to be used on a Field Servie Mobile Flow ?
Hey do you know if it’s possible to send email with attachment when a new service report has been created through apex trigger? In field service when my techs create a service report we have to go in and manually email the pdf report each time, but there has to be a way to do this automatically. Could you help?
 i have a trigger that updates fields on an opportunity when it is created and anytime it is updated anytime after. It adds phone number fields and a few other fields that i can't map over. I need it to also update the opportunity name depending on if the account has a middle name or not. So i am dealing with if and else statements. I had a process builder done and it worked fine for a little bit but now it is not working at all. I will attach what it looks like as well as the trigger that i have so far. SO basically what i need to added to my trigger that i cant seem to figure out how to do is the opportunity name update.
For example-- If the account First Name: Bob --Middle Name: Null -Last Name: Smith  I would want Opportunity name to be updated to Bob Smith 
But if it was --First Name: Bob  - Middle Name: Mary -Last Name: Smith  I would want Opportunity name to be updated to Bob & Mary Smith 

this is the trigger that i have created that updates the opportunity fields 

trigger insertOpportunity on Opportunity(before insert,before update) {

if(trigger.isinsert)
{
for(Opportunity ac : Trigger.new){
try{

List<account> acc=[select id,Water_Source__c,Phone,PersonHomePhone,PersonMobilePhone,Water_Filters__c,PersonMailingStreet,PersonMailingCity,PersonMailingState,PersonMailingPostalCode,Water_Conditions__c,Type_of_Home__c from Account where id=: trigger.new[0].accountid];
trigger.new[0].Water_Source__c=acc[0].Water_Source__c;
trigger.new[0].Home_Phone__c=acc[0].PersonHomePhone;
trigger.new[0].Mobile_Phone__c=acc[0].PersonMobilePhone;
trigger.new[0].Water_Filters__c=acc[0].Water_Filters__c;
trigger.new[0].Street__c=acc[0].PersonMailingStreet;
trigger.new[0].City__c=acc[0].PersonMailingCity;
trigger.new[0].State__c=acc[0].PersonMailingState;
trigger.new[0].Zip_Code__c=acc[0].PersonMailingPostalCode;
trigger.new[0].Water_Condtitions__c=acc[0].Water_Conditions__c;
trigger.new[0].Type_of_Home__c=acc[0].Type_of_Home__c;
trigger.new[0].Phone__c=acc[0].Phone;
}
catch(Exception e ){
}
}
}

}



This is the formula that i had for the process builder that worked but now no longer does and this is what i need the opportunity name to look like 

IF(NOT(ISBLANK([Account].Spouse_Name__c)),
  [Account].FirstName & " " & "&" & " " & [Account].Spouse_Name__c & " " & [Account].LastName,
[Account].FirstName & " " &  [Account].MiddleName & " " &  [Account].LastName
 )
I thought i could do it but it is alot harder than i thought. PLease let me know what all it would take to help me please. We have a basic setup right now and i have been trying to customize it but i cant figure it out and i am short on time. If someone could please help.!!!
 i have a trigger that updates fields on an opportunity when it is created and anytime it is updated anytime after. It adds phone number fields and a few other fields that i can't map over. I need it to also update the opportunity name depending on if the account has a middle name or not. So i am dealing with if and else statements. I had a process builder done and it worked fine for a little bit but now it is not working at all. I will attach what it looks like as well as the trigger that i have so far. SO basically what i need to added to my trigger that i cant seem to figure out how to do is the opportunity name update.
For example-- If the account First Name: Bob --Middle Name: Null -Last Name: Smith  I would want Opportunity name to be updated to Bob Smith 
But if it was --First Name: Bob  - Middle Name: Mary -Last Name: Smith  I would want Opportunity name to be updated to Bob & Mary Smith 

this is the trigger that i have created that updates the opportunity fields 

trigger insertOpportunity on Opportunity(before insert,before update) {

if(trigger.isinsert)
{
for(Opportunity ac : Trigger.new){
try{

List<account> acc=[select id,Water_Source__c,Phone,PersonHomePhone,PersonMobilePhone,Water_Filters__c,PersonMailingStreet,PersonMailingCity,PersonMailingState,PersonMailingPostalCode,Water_Conditions__c,Type_of_Home__c from Account where id=: trigger.new[0].accountid];
trigger.new[0].Water_Source__c=acc[0].Water_Source__c;
trigger.new[0].Home_Phone__c=acc[0].PersonHomePhone;
trigger.new[0].Mobile_Phone__c=acc[0].PersonMobilePhone;
trigger.new[0].Water_Filters__c=acc[0].Water_Filters__c;
trigger.new[0].Street__c=acc[0].PersonMailingStreet;
trigger.new[0].City__c=acc[0].PersonMailingCity;
trigger.new[0].State__c=acc[0].PersonMailingState;
trigger.new[0].Zip_Code__c=acc[0].PersonMailingPostalCode;
trigger.new[0].Water_Condtitions__c=acc[0].Water_Conditions__c;
trigger.new[0].Type_of_Home__c=acc[0].Type_of_Home__c;
trigger.new[0].Phone__c=acc[0].Phone;
}
catch(Exception e ){
}
}
}

}



This is the formula that i had for the process builder that worked but now no longer does and this is what i need the opportunity name to look like 

IF(NOT(ISBLANK([Account].Spouse_Name__c)),
  [Account].FirstName & " " & "&" & " " & [Account].Spouse_Name__c & " " & [Account].LastName,
[Account].FirstName & " " &  [Account].MiddleName & " " &  [Account].LastName
 )
 i have a trigger that updates fields on an opportunity when it is created and anytime it is updated anytime after. It adds phone number fields and a few other fields that i can't map over. I need it to also update the opportunity name depending on if the account has a middle name or not. So i am dealing with if and else statements. I had a process builder done and it worked fine for a little bit but now it is not working at all. I will attach what it looks like as well as the trigger that i have so far. SO basically what i need to added to my trigger that i cant seem to figure out how to do is the opportunity name update.
For example-- If the account First Name: Bob --Middle Name: Null -Last Name: Smith  I would want Opportunity name to be updated to Bob Smith 
But if it was --First Name: Bob  - Middle Name: Mary -Last Name: Smith  I would want Opportunity name to be updated to Bob & Mary Smith 

this is the trigger that i have created that updates the opportunity fields 

trigger insertOpportunity on Opportunity(before insert,before update) {

if(trigger.isinsert)
{
for(Opportunity ac : Trigger.new){
try{

List<account> acc=[select id,Water_Source__c,Phone,PersonHomePhone,PersonMobilePhone,Water_Filters__c,PersonMailingStreet,PersonMailingCity,PersonMailingState,PersonMailingPostalCode,Water_Conditions__c,Type_of_Home__c from Account where id=: trigger.new[0].accountid];
trigger.new[0].Water_Source__c=acc[0].Water_Source__c;
trigger.new[0].Home_Phone__c=acc[0].PersonHomePhone;
trigger.new[0].Mobile_Phone__c=acc[0].PersonMobilePhone;
trigger.new[0].Water_Filters__c=acc[0].Water_Filters__c;
trigger.new[0].Street__c=acc[0].PersonMailingStreet;
trigger.new[0].City__c=acc[0].PersonMailingCity;
trigger.new[0].State__c=acc[0].PersonMailingState;
trigger.new[0].Zip_Code__c=acc[0].PersonMailingPostalCode;
trigger.new[0].Water_Condtitions__c=acc[0].Water_Conditions__c;
trigger.new[0].Type_of_Home__c=acc[0].Type_of_Home__c;
trigger.new[0].Phone__c=acc[0].Phone;
}
catch(Exception e ){
}
}
}

}



This is the formula that i had for the process builder that worked but now no longer does and this is what i need the opportunity name to look like 

IF(NOT(ISBLANK([Account].Spouse_Name__c)),
  [Account].FirstName & " " & "&" & " " & [Account].Spouse_Name__c & " " & [Account].LastName,
[Account].FirstName & " " &  [Account].MiddleName & " " &  [Account].LastName
 )