function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SF_StevenSF_Steven 

convertLead () Function Question

I have a convertLead trigger I'm writing and had a question that I wasn't 100% clear on after some reading.

 

When using that function in an Apex trigger, does convertLead use the field mapping already set in Salesforce or does thiat function as a trigger work independently of the conversion mapping within the system?   In other words, do I need to map out all my custom fields a second time in the trigger?

 

 

Thanks!

SrikanthKuruvaSrikanthKuruva

in the following pdf "mapping fields" on page 221 implies that field mapping is not required for second time in trigger. Are your fields not being mapped?

http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf

SF_StevenSF_Steven

Thanks - I read that too.  That section on field mapping wasn't explicit enough for me.  

 

I haven't tried it yet - but i know i am going to use a trigger for lead conversion.   I just didn't want to setup field mappings in Salesforce.com only to have to write them into the trigger.

SrikanthKuruvaSrikanthKuruva

either way let me know the result just for my knowledge.

SF_StevenSF_Steven

I finally got back to that code - turns out that convertLead() does actually use the default settings without having to write out any maps when using that function.

 

I was very happy to find that out!  :)