in Education by
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 Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
If you are looking for a more simpler design, then you might want to use a static mapper class for this. Here is a pseudo code which might help you solve this problem: public static class CustomMapper { public static void leadToContact(Lead lead, ID contactID) { var contact = new Contact(contactID); ///do mapping here ///eg ///returnval.Newsletter__c = Lead.Newsletter__c; contact.save(); } } Then you could convert the lead to contact prior to usage and get the resulting contact ID. You can do this by the following code: CustomMapper.leadToContact(myOldLead, myContactID); So, now if you perform a conversion, right after performing the custom mapping with an update, it will seem like an instant update to the users. I hope my answer was satisfactory enough.

Related questions

0 votes
    I have an email template that I would like to launch from within the case using a Link/Button. I see the ... Any help you be great Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me what is the difference between custom app and console app in salesforce? Select the correct answer from above options...
asked Jan 9, 2022 in Education by JackTerrance
0 votes
    Salesforce Einstein is considered to be the __________. A. Visualizer B. Personal Calculator C. Personal Data Scientist...
asked Nov 1, 2022 in Education by JackTerrance
0 votes
    I have recently discovered that salesforce.com is much more than an online CRM after coming across a Morrison's Case ... ' .Net route? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    The Salesforce.com API seems to assume that you will always use the app as an active user. Their ... require user interaction? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have a page with a form that posts to salesforce.com's webto Lead service. I am trying to make an ... receiving website can see? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    The Salesforce.com API seems to assume that you will always use the app as an active user. Their ... require user interaction? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I have a page with a form that posts to salesforce.com's webto Lead service. I am trying to make an ... receiving website can see? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Is there a library or package which we can use with python to connect to salesforce and get data? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I would like to integrate SalesForce information into a .net MVC application. The samples on SalesForce website are ... .NET Thanks. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I would really appreciate if someone can guide me to check if a particular field is included in update call inside ... . Many thanks. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm a little confused. We downloaded the WSDL file from Salesforce and created a web reference to it using a ... step? Any advice? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    Friends, I have a contact us/Inquiry form in my website. I want to generate a lead in Sales force CRM on ... any link for API. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm trying to get an authorization token using the Username-Password flow (as described in the final section of this ... work for me. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm trying to update a record via the SalesForce API (Enterprise WSDL). The code below executes fine, and the ... updateParticipant }); if (result == null || result.Length...
asked Feb 2, 2022 in Education by JackTerrance
...