You need to sign in to do that
Don't have an account?

please solve this question on trigger using map
Create object : Candidate__c
Fields : (All Text fields)
First Name
Last Name
Email
Brokerage
Manage Brokerage
Candidate Status (Webinar - Attended , Webinar -Not Attended)
User Created ( checkbox)
On insert:
1. Create Account if Brokerage !=null
2. Create another account if Manage Brokerage != null and set parentId = Brokerage account id (created in 1 point)
3. Create new contact record and set accountId = Manage Brokerage account id (created in 2 point)
create new field candidate__c(lookup) on contact and fill it with Condidate__c record id
4. Create task record for contact record (created in point 3)
Task.WhoId = contactId
Task.WhatId = Candidate__c
Task.Subject = 'Portal Contact Setup';
Fields : (All Text fields)
First Name
Last Name
Brokerage
Manage Brokerage
Candidate Status (Webinar - Attended , Webinar -Not Attended)
User Created ( checkbox)
On insert:
1. Create Account if Brokerage !=null
2. Create another account if Manage Brokerage != null and set parentId = Brokerage account id (created in 1 point)
3. Create new contact record and set accountId = Manage Brokerage account id (created in 2 point)
create new field candidate__c(lookup) on contact and fill it with Condidate__c record id
4. Create task record for contact record (created in point 3)
Task.WhoId = contactId
Task.WhatId = Candidate__c
Task.Subject = 'Portal Contact Setup';
You can try this code snipet: And if it works for you Mark your best answer to help others.
Thanks
Niraj
Just Try this one out,
There is one line commented in Task creation of whatId, That should Non - commented only when the
Candidate object is the child object of Account.
Thanks
Akshay
It could be because of in your org, there would be some more required fields present,
I could not get you completely, so just clarify what you are saying
So, that I can help you.
I have tested this code on my end and its working fine absolutely.
Thanks
Akshay
akshay can you make it using handler
You can try once the above one which is written using handler.
of course you can do this by the handler as well --
-------------------- Trigger --------------------------------------
Thanks
Akshay