You need to sign in to do that
Don't have an account?
SalesforceAddict
please help to soalve this assignment
Assignment 1. Create Batch Class to Process Stagings and insert Opportunity
Object: staging__c
Fields:
Requirement:
Case1. If Individual_or_Organization__c==I ,
Case2. If Individual_or_Organization__c==O
Field Mapping for Opportunity:
OpportunityName = Account Name or Contact Name+CloseDate
ColseDate = Date_Recieved__c
Amount = Amount__C
Description=Description__c
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.
Case2. If Individual_or_Organization__c==O
- Search for existing Account with matching Organization_Name__c and Postal Code. If Account not found then create new account.
- If staging record contains value in Last_Name__c and Postal_Code__c Fields then search for contact with matching firstname,lastname and postal code. If contact found then link contact record with the account.
- Create Opportunity record for account
Field Mapping for Opportunity:
OpportunityName = Account Name or Contact Name+CloseDate
ColseDate = Date_Recieved__c
Amount = Amount__C
Description=Description__c
I have replied the same in your one of question (reuse and update according to your case 2, it will work.):
https://developer.salesforce.com/forums?id=9060G0000005heyQAA