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

I want to write a trigger on custom object(contact), to create a child record of it.
sceneria is as follow:
In cantact i have field called referred by email(contact emailid of other ).
I have created child object of contact as referral points.
Now i have create child record once referred by email field is updated.
but chalenge is i am getting emailId of referred contact, so i neet to get the contact name of that emailId and then i should give points to him(reating childrecord).
In cantact i have field called referred by email(contact emailid of other ).
I have created child object of contact as referral points.
Now i have create child record once referred by email field is updated.
but chalenge is i am getting emailId of referred contact, so i neet to get the contact name of that emailId and then i should give points to him(reating childrecord).
You wish to find that contact and create a child record for that contact..
You can try the following pseudocode:
1)Create an after insert/update trigger on Contact(custom object)
2)fetch the referred by email address field and run a SOQL query to find the contact with the same email address
3)create the child record under that contact