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
SFAshSFAsh 

Mapping Lead's custom fields to Contact's custom fields C#

I wanted to map custom fields of lead to map with custom field of contact' when converted using "binding.convertLead()".

It should replicate the behaviour what we are manually doing from UI when custom fields of Lead are mapped with contact(Navigate to SetUp->Customize->Leads->Fields then in "Lead Custom Fields & Relationships" section "Map Lead Fields" button.)

I have the C# code to convert a lead into contact. However I need to map the custom fields of lead to custom fields of contact.

Like for e.g:

1) Lead.Newsletter__c (Custom field of check box type in lead)

2) Contact.Newsletter__c(Custom field of check box type in contact)

3) Now, if "Lead.Newsletter__c" is checked then when I convert any lead to contact, then "Contact.Newsletter__c" should be checked automatically.

I am able to fetch all the custom fields by using "describeSObjects" of Partener WSDL proxy class, but still unable to located where the changes should be made

Any help appreciated.
Best Answer chosen by SFAsh
Ramu_SFDCRamu_SFDC
Hi, As per my knowledge and my search, it is not possible to define a field mapping for lead convert through apex. You can do the lead convert using apex but not the mapping. Mapping should be done through UI which is called when you convert the lead through apex.

Hope this helps !

All Answers

Ramu_SFDCRamu_SFDC
Hi, As per my knowledge and my search, it is not possible to define a field mapping for lead convert through apex. You can do the lead convert using apex but not the mapping. Mapping should be done through UI which is called when you convert the lead through apex.

Hope this helps !
This was selected as the best answer
SFAshSFAsh
Hi Ramu,

I exactly had researched same thing as you mentioned above.
I am still not able to digest that SF dont provide mapping via proxy class or APIS.

Marking it as answer.

Hope they provide this in thier next release.

Many Thanks
Ashish