You need to sign in to do that
Don't have an account?
sfdc newbie
how to get close date in convert lead page
how to get close date in convert lead page?
here i have created a custom conert lead page.
in that i have applied the code for close date in opportunity section in vf:
<apex:pageBlockSectionItem id="oppCloseDateSection" rendered="true">
<apex:outputlabel for="opportunityCloseDate" value="Close Date" />
<apex:outputPanel styleClass="requiredInput" layout="block">
<apex:outputPanel styleClass="requiredBlock" layout="block" />
<apex:inputField id="oppCloseDate" value="{!opportunity.CloseDate}" />
</apex:outputPanel>
</apex:pageBlockSectionItem>
and in Apex class:
//If user decides to create Opportunity, insert new Opportunity
if (!doNotCreateOpportunity) {
try {
if (opportunity.Opportunity_XXX__c == 'XXX') opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'XXX'].Id;
else if (opportunity.Opportunity_Intergaph_XXX__c == 'YYYY) opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'YYYY'].Id;
else if (opportunity.Opportunity_XXX__c == 'zzzz') opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'zzzz'].Id;
else opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'PPP'].Id;
opportunity.AccountId = account.Id;
opportunity.Name = opportunityName;
opportunity.StageName = 'Lead 0%';
opportunity.CloseDate = lead.Close_date__c;
//opportunity.XXX__c = lead.XXX__c;
insert opportunity;
here i have created a custom conert lead page.
in that i have applied the code for close date in opportunity section in vf:
<apex:pageBlockSectionItem id="oppCloseDateSection" rendered="true">
<apex:outputlabel for="opportunityCloseDate" value="Close Date" />
<apex:outputPanel styleClass="requiredInput" layout="block">
<apex:outputPanel styleClass="requiredBlock" layout="block" />
<apex:inputField id="oppCloseDate" value="{!opportunity.CloseDate}" />
</apex:outputPanel>
</apex:pageBlockSectionItem>
and in Apex class:
//If user decides to create Opportunity, insert new Opportunity
if (!doNotCreateOpportunity) {
try {
if (opportunity.Opportunity_XXX__c == 'XXX') opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'XXX'].Id;
else if (opportunity.Opportunity_Intergaph_XXX__c == 'YYYY) opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'YYYY'].Id;
else if (opportunity.Opportunity_XXX__c == 'zzzz') opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'zzzz'].Id;
else opportunity.RecordTypeId = [SELECT Id FROM RecordType WHERE Name = 'PPP'].Id;
opportunity.AccountId = account.Id;
opportunity.Name = opportunityName;
opportunity.StageName = 'Lead 0%';
opportunity.CloseDate = lead.Close_date__c;
//opportunity.XXX__c = lead.XXX__c;
insert opportunity;
bob_buzzard
What problem are you seeing?
sfdc newbie
when i save it is not showing me any error but when i insert values in the opportunity and other sections in the page close date getting cleared and showing an error like close date missing.
sfdc newbie
and it is required even i have created a custom field and tested in the opportunity object