• Sarah S
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
hey guys, 
i am setting up email relay in salesforce but its not working.

we have mimecast SMTP server and user is created on that.

I have setup email relay, email domain filter and deliverability setting as suggested in salesforce help docs.

I am doing 'test deliverability' but receiving email from salesforce only 'noreply@salesforce.com' instead of our SMTP server.
i have checked the email log file and the error is '435 5.7.8 Authentication credentials invalid' but this is fishy because I am entering the correct username and password provided by SMTP server team, infact i asked the SMTP server team to create new user and provide, but it is still the same error.

i am no expert in reading the email log file, and i dont understand that for some row there is no entry in coloum 'M' relay address, why is that, when email relay is enabled it should be for all the email initiated form Salesforce.

what am i missing?

What is wrong? 
I want custom domain like this-
my.salesforce.mycompany.com OR just this abc.mycompany.com as my salesforce domain.

NOT this- mycompany.my.salesforce.com
requirement - generate Sales Order form and attach as pdf in note and attachment of Order Object.

solution approach - a button on order details page 'Generate Sales Order Form' on clicking this button VF or LWC will launch with some order details and user can hit save on this form. On Save how to save this vf/lwc as pdf and attach in notes and attachment of order object.
Hello
I am getting below error while running the test class.

System.DmlException: Insert failed. First exception on row 0 with id 0010I00002TQaLoQAL; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]


My trigger is-
---------------------

trigger NewAccountTrigger on Account (before insert, before update, before delete, after insert, after update, after delete, after undelete) {
    
    if(Trigger.isBefore){
        if(Trigger.isInsert){
        //call the handler method BEFORE INSERT
        NewAccountTriggerHandler.beforeInsert(Trigger.new);  
        }
        else if(Trigger.isUpdate){
              //call the handler method BEFORE UPDATE   
             NewAccountTriggerHandler.beforeUpdate(Trigger.new);  
            }
        else if(Trigger.isDelete){
                //call the handler method BEFORE DELETE
                NewAccountTriggerHandler.beforeDelete(trigger.old);
    }
        }
    if(Trigger.isAfter){
 }
}

My Trigger Handler Class-
--------------------------------------
public class NewAccountTriggerHandler {
    
    public static void beforeInsert(list<Account> accs){
      for (Account a : accs){
                a.Nick_Name__c = 'FromBeforeinsertHandlerClass';
            }       
    } 
    
    public static void beforeUpdate(list<Account> accs){
   //Do something here      
    } 
    
    public static void beforeDelete(list<Account> accs){
    //do something here
                }    
    } 

My test class is -
-------------------------
@isTest
private class NewTestAccountTriggerHandler {
    @isTest static void TestBeforeInsert() {
        // Test data setup
        list<account>accountlist = new list <account>();
        account acct1 = new account();
        acct1.name = 'Trigger test 1';
        accountlist.add (acct1);
        insert  accountlist ;
        
        // Perform test
        Test.startTest();
        
        Database.SaveResult[] result = Database.insert(accountlist, true);

        Test.stopTest();
        // Verify 
        System.assert(result[0].isSuccess());
        System.assertEquals(accountlist[0].Nick_Name__c, 'FromBeforeinsertHandlerClass');
        
    }
    
}
 
Hello,
Please help me, how do I call below class from the anonymous window. I am not finding a way to pass IDs as parameter.
I want pass record Ids of Account for example this 0010I00001hMhFIQA0. 
___________________________ 
public class AccountClass {
    public static void CountMyContacts(Set<ID> recordIds){
    List<Account> accs = [Select Id, Name from Account Where Id IN :recordIds];
    for (Account a : accs){
    List<Contact> Cons = [Select Id, Name from Contact Where AccountId = :a.Id];
        integer ConCount = Cons.size();
        system.debug( Account.Name + 'account has' + ConCount + 'number of contacts');
       }
    }            
}
hey guys, 
i am setting up email relay in salesforce but its not working.

we have mimecast SMTP server and user is created on that.

I have setup email relay, email domain filter and deliverability setting as suggested in salesforce help docs.

I am doing 'test deliverability' but receiving email from salesforce only 'noreply@salesforce.com' instead of our SMTP server.
i have checked the email log file and the error is '435 5.7.8 Authentication credentials invalid' but this is fishy because I am entering the correct username and password provided by SMTP server team, infact i asked the SMTP server team to create new user and provide, but it is still the same error.

i am no expert in reading the email log file, and i dont understand that for some row there is no entry in coloum 'M' relay address, why is that, when email relay is enabled it should be for all the email initiated form Salesforce.

what am i missing?

What is wrong? 
Hello
I am getting below error while running the test class.

System.DmlException: Insert failed. First exception on row 0 with id 0010I00002TQaLoQAL; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]


My trigger is-
---------------------

trigger NewAccountTrigger on Account (before insert, before update, before delete, after insert, after update, after delete, after undelete) {
    
    if(Trigger.isBefore){
        if(Trigger.isInsert){
        //call the handler method BEFORE INSERT
        NewAccountTriggerHandler.beforeInsert(Trigger.new);  
        }
        else if(Trigger.isUpdate){
              //call the handler method BEFORE UPDATE   
             NewAccountTriggerHandler.beforeUpdate(Trigger.new);  
            }
        else if(Trigger.isDelete){
                //call the handler method BEFORE DELETE
                NewAccountTriggerHandler.beforeDelete(trigger.old);
    }
        }
    if(Trigger.isAfter){
 }
}

My Trigger Handler Class-
--------------------------------------
public class NewAccountTriggerHandler {
    
    public static void beforeInsert(list<Account> accs){
      for (Account a : accs){
                a.Nick_Name__c = 'FromBeforeinsertHandlerClass';
            }       
    } 
    
    public static void beforeUpdate(list<Account> accs){
   //Do something here      
    } 
    
    public static void beforeDelete(list<Account> accs){
    //do something here
                }    
    } 

My test class is -
-------------------------
@isTest
private class NewTestAccountTriggerHandler {
    @isTest static void TestBeforeInsert() {
        // Test data setup
        list<account>accountlist = new list <account>();
        account acct1 = new account();
        acct1.name = 'Trigger test 1';
        accountlist.add (acct1);
        insert  accountlist ;
        
        // Perform test
        Test.startTest();
        
        Database.SaveResult[] result = Database.insert(accountlist, true);

        Test.stopTest();
        // Verify 
        System.assert(result[0].isSuccess());
        System.assertEquals(accountlist[0].Nick_Name__c, 'FromBeforeinsertHandlerClass');
        
    }
    
}
 
Hello,
Please help me, how do I call below class from the anonymous window. I am not finding a way to pass IDs as parameter.
I want pass record Ids of Account for example this 0010I00001hMhFIQA0. 
___________________________ 
public class AccountClass {
    public static void CountMyContacts(Set<ID> recordIds){
    List<Account> accs = [Select Id, Name from Account Where Id IN :recordIds];
    for (Account a : accs){
    List<Contact> Cons = [Select Id, Name from Contact Where AccountId = :a.Id];
        integer ConCount = Cons.size();
        system.debug( Account.Name + 'account has' + ConCount + 'number of contacts');
       }
    }            
}
Hi guys,
i recently completed 100% of the admin beginner trail, but salesforce still didn't add it up to my trail's count on my profile, what should i do? thank you