You need to sign in to do that
Don't have an account?
i have made fields i want to help for apex class code
Opportunity
Object: staging__c
Fields:
Requirement:
Case1. If Individual_or_Organization__c==I ,
Object: staging__c
Fields:
- Individual_or_Organization__c (Text)
- Organization_Name__c
- First_Name__c
- Last_Name__c
- Postal_Code__c
- Date_Recieved__c (Date)
- Amount__c (Currency)
- Error_Message__c (Long Text)
- Description__c
Requirement:
Case1. If Individual_or_Organization__c==I ,
- Search for existing contact with matching FistName , LastName and Postal Code. If contact not found then create new contact.
- If staging record contains value in Organization_Name__c and Postal_Code__c Fields then search for account with matching name and postal code. If account found then link contact record with this account.
- Create new opportunity record for that contact.
Try this code and if it works for you marked it of your ans to help others.
Run this script from your developer console to process:
Let me know if you face any problem.
Note: You can add fields for Contact/Opportunity according to your requirements at line no: 23 / 62.
You do not have to any things for your case1.
If it solves your problem mark your ans.