You need to sign in to do that
Don't have an account?
MNaethler
Trigger action before Converting
Hey guys,
i need to know how i can write a trigger that he will fire before i convert a lead into a company, that the trigger can check if the company is already there and perform a merge then? any ideas?
You need to enable "validation and triggers from lead convert". To enable this from Setup, click Customize | Leads | Settings. Select "Enable Validation and Triggers from Lead Convert".
If this option is not available you will need to file a Premier Support ticket to have SFDC enable it on the backend.
http://login.salesforce.com/help/doc/en/customize_leadsettings.htm
http://login.salesforce.com/help/doc/en/leads_convert.htm
I already have this setting enabled, thanks anyway.
I meant how i can say the trigger that i want him to start before convertin,
like in another trigger from me :
trigger preventDuplicatedLeadEntries on Lead (before insert, before update)
i tried smthn like (before convert) but it aint exists, if u know what i mean
what have i do, i tried to take (before convert) but it aint exist if u know what i mean?
Something like this will suite your needs:
hey again,
and well, it aint works.
i did it exactly but the trigger seems not to start,
for better explanaiton, before i click on convert, i want that if the trigger checks that we got double entries, that he opens automatically a popup where i can merge all fields manually.
i dont have the popup atm, but he should still send an error message as u can see
System.Trigger.isInsert will always evaluate to false for a (Before Update) trigger. I am not sure why your trigger is set to compare phone, street, etc.
Are you wanting to check to ensure there are not multiple companies being converted at once? Or are you wanting to check existing companys?
If you want a popup, to intercept prior to committing you will need a visual force page with a custom controller instead of a trigger.
hey Tim,
i want to check if a company exists when i tried to convert a new lead
couldn't i call the the visual force page from the trigger to "pop up" ?
No. A popup would be on the front end and you are wanting to manipulate it from the database level. Those most you could do is to throw an error before the DML completes.
You would need a custom VF page and controller to manipulate the UI it in this way.
oh damned, ok thank you :)
still got this prob with the check if other companies or accounts with same adress maybe or email, but i think we take an existing app,
so thanks anyway