• Alex_Groag
  • NEWBIE
  • 0 Points
  • Member since 2019
  • Salesforce Admin
  • Nexus Systems

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi - I've sourced the code below for automatically converting a lead when criteria are met in process builder. I'd like to modify it to:

1) I'd like it to check if the email exists in a contact and merge the lead into that contact.
2) If a contact doesn't exist, but account does (company name match) merge lead into new contact related to account.
3) If neither, let code run as it normally does, create account and contact.  

Here is the code, any help would be greatly appreciated. 

Public class AutoConvertLeads
{
    @InvocableMethod
    public static void LeadAssign(List<Id> LeadIds)
    {
        LeadStatus CLeadStatus= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];
        List<Database.LeadConvert> MassLeadconvert = new List<Database.LeadConvert>();
        for(id currentlead: LeadIds){
                Database.LeadConvert Leadconvert = new Database.LeadConvert();
                Leadconvert.setLeadId(currentlead);                
                Leadconvert.setConvertedStatus(CLeadStatus.MasterLabel);
                Leadconvert.setDoNotCreateOpportunity(TRUE); 
                MassLeadconvert.add(Leadconvert);
        }
        
        if (!MassLeadconvert.isEmpty()) {
            List<Database.LeadConvertResult> lcr = Database.convertLead(MassLeadconvert);
        }
    }
}
Has anyone implemented the work around for this known issues? https://success.salesforce.com/issues_view?id=a1p3A000000erW7QAI

Currently, an external object lookup field appears to be null in lightning.  When I click edit in lightning I can see the field is populated.  When I switch back to classic, the funtionality of the field works.  I was told this is an OData query issue, but I'm not a developer and do not know where to start for the work around.  

Any help would be great, Thanks.
Hi - I'm getting this error in Salesforce when trying to access documents in Sharepoint, "External Object Error OAuth token expired." I've tried getting in contact with Sharepoint support but they told me to contact Salesforce, and we don't have the premium support for developer support from Salesforce.  

Name items_Sharepoint
External Data Source Sharepoint
Status OAuth token expired

Does anyone have experience with Sharepoint and refreshing a security token? I've tried to go through documentation but I'm having trouble getting the connection working again.  

I can see sharepoint in our external data sources as well as Auth. Providers.  
 
I’ve been tasked with automatically ranking our Accounts based on the qty listed in a "projected volume" field. Any suggestions?

Thanks in advance!

Ben