• arjuna Rajput 29
  • NEWBIE
  • 15 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 19
    Replies
RIGHT({!$Record.Email}, LEN({!$Record.Email}) - FIND("@",{!$Record.Email}))

this formula extract domain name from email
suppose abc@jbl.com
result of this formula is: jbl.com

but ineed jbl only extract from email can anyone help me out to give correct formula
public class ContactEmailHelper {
    public static void onBeforeInsert(Contact ct)
    {
         Set<String> emailDomains = new Set<String>();
        String Domain;
        if(ct.email!=null)
        {
            Domain=(ct.Email.split('@').get(1)); 
            emailDomains.add(Domain.replace('.com',''));
        }
       List<Account> acc= new List<Account>([select id,Name from Account where Name in :emailDomains]);
// what i write after here to check that my domain name matches to account name if it matches then assign domain name to contact
    
    
    }
  

}
user fill contact field details in lightning..When user enter their email
abc@gmail.com.
after fill. we check after that we create contact the field email get xtracted
show account name fied automatically filled with gmail.means that gmail account is already in Account object
using flows create a task on opportunity if task exist then update and otherwise create.
Using Screen Flows
suppose email as ac@gmail.com
after extraction we got gmail only.
we put this formula in resorce formula field
see question is
-Whenever we create new contact we entered email feild suppose arj@cyno.com.
-When we check after creating contact when we see details of contact that we create account name field already fill name cyno.
-in this we extract  doamin name from email and  account field already or automatic fill with name cyno......

-Please answer me using Trigger (trigger design pattern) and triggered flows
Create a trigger on Contact which extract domain from email field and check if any account of same name exists.

eg
: -abc@gmail.com 
-after extract get gmail.
-then it check gmail field  e in account object
if user enter abc@salesforce.com
then flows will check salesforce.com account is in system or not
trigger AccountCategory on Account (before insert,before update) { For (Account acc:Trigger.new){ if(acc.salary__c <=10000) acc.category__c='sample1'; else if (acc.salary__c>10000 && acc.Salary__c<=100000) acc.Category__c='sample2'; else acc.Category__c='sample3'; } }
public class ContactEmailHelper {
    public static void onBeforeInsert(Contact ct)
    {
         Set<String> emailDomains = new Set<String>();
        String Domain;
        if(ct.email!=null)
        {
            Domain=(ct.Email.split('@').get(1)); 
            emailDomains.add(Domain.replace('.com',''));
        }
       List<Account> acc= new List<Account>([select id,Name from Account where Name in :emailDomains]);
// what i write after here to check that my domain name matches to account name if it matches then assign domain name to contact
    
    
    }
  

}
user fill contact field details in lightning..When user enter their email
abc@gmail.com.
after fill. we check after that we create contact the field email get xtracted
show account name fied automatically filled with gmail.means that gmail account is already in Account object
suppose email as ac@gmail.com
after extraction we got gmail only.
we put this formula in resorce formula field
see question is
-Whenever we create new contact we entered email feild suppose arj@cyno.com.
-When we check after creating contact when we see details of contact that we create account name field already fill name cyno.
-in this we extract  doamin name from email and  account field already or automatic fill with name cyno......

-Please answer me using Trigger (trigger design pattern) and triggered flows
Create a trigger on Contact which extract domain from email field and check if any account of same name exists.

eg
: -abc@gmail.com 
-after extract get gmail.
-then it check gmail field  e in account object
if user enter abc@salesforce.com
then flows will check salesforce.com account is in system or not
trigger AccountCategory on Account (before insert,before update) { For (Account acc:Trigger.new){ if(acc.salary__c <=10000) acc.category__c='sample1'; else if (acc.salary__c>10000 && acc.Salary__c<=100000) acc.Category__c='sample2'; else acc.Category__c='sample3'; } }