You need to sign in to do that
Don't have an account?
Akshay Mhetre
Hello Experts,
How to create Case/Record on custom object with apex logic.
Hello Experts,
- There are 2 objects. Lookup(Applicant) and Bank . (Lookup Relationship).
- There is One checkbox is on Applicant- AreYouSure__c
- There is One Picklist- Applicant_Type__c with values -- Male, Female , Both.
- On Applicant when AreYouSure__c=true, then it will ask for Applicant_Type__c New? or Old ?, or both of them?
- If Applicant_Type__c =both, then bank record needs to be created only for ‘Male’, and stamp the relevant applicant’s Applicant Id.
- If it’s checked for only one of them, then create a record for the one for which the flag is true and stamp the relevant applicant’s Applicant Id.
- If AreYouSure__c=false , then don't create a record.
Thanks!!
All Answers
As per my understanding,
1.when application record created with type both & AreYouSure__c=true then bank record needs to be created.
2.when application record created with type Male/Female & AreYouSure__c=true then bank record needs to be created.
3. If AreYouSure__c=false , then don't create a bank record.
when user selects the AreYouSure__c=true then is there any validation rule to alert the user like "please select the Applicant_Type__c "
Please correct me if am wrong.
Thanks!!
Hi Ankaiah,
When creation of Applicant record is going on (on Applicant obj), there is one checkbox AreYouSure__c ,if its selected as True, then next,User will choose Male/Female/Both from Applicant_Type__c picklist. Once Applicant record gets created,at the same time I need to generate Bank record related to Applicant Record.
Your above understanding is correct but No need of any validation. I just need code. I am not versed with Map or List..Can you please provide me simple code for above logic.
Thanks
Try with below code.
If this helps, Please mark it as best answer.
Thanks!!
Hello Ankaiah
You are awsome.Thanks.
Instead of writing Trigger Is it possible to write trigger logic in Apex class.
Thanks!!