• Ted Tk
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi,

I have a code, where when a status is changed mail will be triggered.

Below is the snippet:
    mail.setReplyTo('abc@abc.com');
    mail.setSenderDisplayName('Test Sender Name');

When I receive the mail, it shows in display name as my name in the to list but when I click reply it is showing "abc@abc.com". I am confused. Can you please help me out?
  • March 24, 2016
  • Like
  • 0
Hi,

I want to fetch more than 50000 records and send it as response via rest api. I just want to show the data and no dml operations are performed. Can you suggest me a solution where I can overcome the soql limit exception?
  • March 22, 2016
  • Like
  • 0

Hello!
I am very new to both Salesforce and Apex, so go easy on me!

I am trying to create an Apex trigger, which creates a Contact record and automatically populates some of the fields, when someone creates a User with '@companyname.com' in the email address.

I was able to do this with Process Builder somewhat, however the only field I can't seem to populate that way, is the Account Name.  So I'm attempting to do it in Apex, though my programming knowledge is limited to Python and HTML.  Here is the code I was able to piece together, which unfortunately is still very much a rough draft.

trigger NewContactOnUser on User (after insert) {
    List<Contact> Contact_List = new List<Contact>();
    for (User New_User: trigger.new){
       
        //Conditional statement to check if new contact has @companyname.com in email field
        Contact contact_variable = new_contact();
        String new_contact_string = contact_variable.emailvalue__c;
        if (new_contact_string.contains('@companyname.com')){
  
         Contact New_Contact = new.Contact();
         New_Contact.FirstName = New_User.FirstName;
         New_Contact.LastName = New_User.LastName;
         New_Contact.Email = New_User.Email;
                contacts.add(New_Contact);
        }
    }
    insert Contact_List;
}

So I suppose my question is, how would I eventually get it to populate the Account Name field?  I did '(after insert)' because I think I need the ID for the user after it is created to then get the account name.

 

Thanks for any and all help!

Hi,

I have a code, where when a status is changed mail will be triggered.

Below is the snippet:
    mail.setReplyTo('abc@abc.com');
    mail.setSenderDisplayName('Test Sender Name');

When I receive the mail, it shows in display name as my name in the to list but when I click reply it is showing "abc@abc.com". I am confused. Can you please help me out?
  • March 24, 2016
  • Like
  • 0
Hi,

I want to fetch more than 50000 records and send it as response via rest api. I just want to show the data and no dml operations are performed. Can you suggest me a solution where I can overcome the soql limit exception?
  • March 22, 2016
  • Like
  • 0