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
yogesh_patilyogesh_patil 

Error: Value 'Send Letter' cannot be converted from Text to core.apexpages.el.adapters.metadata.VFSObjectELAdapter?

Whenever I amclicking on the convert button i am geting this error..

please help....

My visualforce code

<apex:page standardController="Lead" extensions="LeadConvertClass">    
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton value="Convert" action="{!save}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Convert Lead">
                <apex:selectList value="{!strCompanyName}" label="Account Name" size="1">
                    <apex:selectOptions value="{!CompanyNames}" />
                </apex:selectList>
                <apex:inputField value="{!objOpportunity.Name}"/> 
                <apex:inputField value="{!objLead.Status}" />
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Task Information">
                <apex:inputField value="{!objTask.Subject}"/>
                <apex:inputField value="{!objTask.Status}" />
                <apex:inputField value="{!objTask.priority}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection >
                <apex:inputField value="{!objLead.Description}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Reminder">
              <!--  <apex:inputField value="{!objLead.ReminderDateTimeId}"/> -->
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

My Apex Code

public class LeadConvertClass {

    public LeadConvertClass(ApexPages.StandardController controller) {
    
        objLead  =new Lead();
        objContact =new Contact();
        objAccount =new Account();
        objOpportunity =new Opportunity();
        listCompanyNames =new List<SelectOption>();
    //    listCompanyNames.add(new SelectOption('USA','USA'));
    //    listCompanyNames.add(new SelectOption('IND','IND'));
        strId=apexpages.currentpage().getparameters().get('id');
        System.debug('@@@strId'+strId);
        objLead.status='Closed-Converted';
    
    }


   
    public Lead objLead {get ; set ;}
    public Contact objContact {get ; set ;}
    public Account objAccount {get ; set ;}
    public Opportunity objOpportunity {get ; set ;}
    public Task objTask {get ; set ;} 
    public List<SelectOption> listCompanyNames {get ; set ;}
    public String strCompanyName {get ; set ;}
    public String strId;
    public String strLeadCompany;
    public String strQuery;
    
    public List<SelectOption> getCompanyNames(){
    Lead objLead =[Select id,Company from Lead where id =:strId];
    strQuery ='Select name from Account where name LIKE \'%'+objLead.Company+'%\'';
    List<Account> listAccount=database.query(strQuery);
    listCompanyNames.add(new SelectOption('none','none'));
    listCompanyNames.add(new SelectOption('Create New Account :'+objLead.Company,'Create New Account :'+objLead.Company));
    if(listAccount!=null){
    for(Account objAccount:listAccount)
    {    
         listCompanyNames.add(new SelectOption(objAccount.name,objAccount.name));   
    }
   
   }        
    objOpportunity.Name=objLead.Company;
    return listCompanyNames;
    }
    
    public PageReference save()
    {
        System.debug(strId);
        System.debug(objOpportunity.name);
        System.debug(objAccount.name);
        System.debug(objLead.Status);
        if(strCompanyName!=null){
            insert objAccount;        
        }
        objContact.AccountId=objAccount.id;
        insert objOpportunity;
        update objLead;
        return null;
    }
}


### 

Error: Value 'Call' cannot be converted from Text to core.apexpages.el.adapters.metadata.VFSObjectELAdapter*

This Error is visible under Subject Field