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

Trigger Code
I Add one Contact immidiately trigger fire and automatically assign an account to that contact please help us in this case "" code for write a trigger for add a account when u create an account ?""
Hi,
Please provide discribe your requirment. It is easy to understand
Thanks
Ashlekh
I am new one to SFDC write a trigger to fire and add account when we add a contact " trigger is in contact
Hi,
When ever you create a contact record then that record always asked for account name because Account Object is Parent object for contact.
But if you want to create a new trigger when your contact record is created than it is very simple.
1) Just click on you Name at right hand side.
2) Than click on setup link.
3) After that click on Customize at right hand side under App Setup Section.
4) Than click on Contact standard object and than click on Trigger.
5) Now click on New button.
Just paste this code.
trigger AccountInsert on Contact (after insert)
{
/*
Create a new instance of Account sobject if you want to insert a single account record
*/
Account acct = new Account( name = 'Test Account' ); //I have hardcode the name but can take the value from your inserted contact record
insert acct;
/*
If you want to create more than one account than use other approch for this because we never use many DML's (Salesfroce has put limitation on
that)
*/
}
Here we are not handling bulk data.
If you face any problem than tell me
Thanks
Ashlekh
If this your solution than mark as a solution And Dont forget to click on star icon under my D-hores name
Salesforcenow.blogspot.in | | https://www.facebook.com/Ashlekh | | @AshlekhGera