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
Vivek Ravi 9Vivek Ravi 9 

leadconvert.setting metadata

Hello All, 
Please help me out in this issue. I am currently working on lead mapping conversion. I have an custom  field called "context" in Lead object mapping to "Context" field in opportunity object. Since we use metadata to deploy the configurations, from version 39.0, it is allowed to use Leadconvert.setting file to map the fields in lead conersion. so i have written my code in the below format as suggested in Salesforce develoer page https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_leadconvertsettings.htm

I have created this file under setings folder as leadcovert.settings
<?xml version="1.0" encoding="UTF-8"?>
<LeadConvertSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <allowOwnerChange>false</allowOwnerChange>
    <objectMapping>
        <inputObject>Lead</inputObject>
        <mappingFields>
            <inputField>Business_Org__c</inputField>
            <outputField>Business_Org__c</outputField>
        </mappingFields>
        <mappingFields>
            <inputField>Campaign_Cell__c</inputField>
            <outputField>Campaign_Cell__c</outputField>
        </mappingFields>
        <mappingFields>
            <inputField>Priority__c</inputField>
            <outputField>Priority__c</outputField>
        </mappingFields>
        <mappingFields>
            <inputField>Source_Desc__c</inputField>
            <outputField>Source_Desc__c</outputField>
        </mappingFields>
        <mappingFields>
            <inputField>Source__c</inputField>
            <outputField>Source_Type__c</outputField>
        </mappingFields>
        <mappingFields>
            <inputField>Tracking_Code__c</inputField>
            <outputField>Campaign_Tracking_Code__c</outputField>
        </mappingFields>
        <mappingFields>
            <inputField>Context__c</inputField>
            <outputField>Context__c</outputField>

        </mappingFields>
        <outputObject>Opportunity</outputObject>
    </objectMapping>    
</LeadConvertSettings>

package.xml file contains
<!-- leadconvert setting -->
    <types>
    <members>LeadConvert</members>
    <name>Settings</name>
    </types>
    <!-- leadconvert end -->

so if i deploy the above code, i get this error "package.xml -- Error: The object 'LeadConvert' of type Settings metadata does not exist". Please let me know the issue. I also wanted to know if i need to include the existing mapped field values in the leadconvert.settings file or just the new mapping values??
Best Answer chosen by Vivek Ravi 9
Vivek Ravi 9Vivek Ravi 9
Hello All,

yes, for the lead conversion mapping, we need to retain the existing values and add the new values into salesforce. the file name  is  LeadConvertSettings.Leadconvertsetting. Used Ant migration tool to fetch the file from the production. the package.xml includes
<types>
    <members>*</members>
    <name>LeadConvertSettings</name>
    </types>.
Thanks