You need to sign in to do that
Don't have an account?
How to pass date as a parameter from custom button url to constructor
Hi, I have created a detail custom button of url type and passing Opportunity Date as shown below.
/apex/vfpage?oliId={!OpportunityLineItem.Id} && oppDate={!Opportunity.customDate__c}
And in apex constructor i am receiving the custom date value as below.
customDate = Date.valueOf(ApexPages.currentPage().getParameters().get('oppDate'));
But I am receiving error as
"Argument cannot be null. An unexpected error has occurred. Your development organization has been notified. "
How to pass the oppDate from url to constructor.
/apex/vfpage?oliId={!OpportunityLineItem.Id} && oppDate={!Opportunity.customDate__c}
And in apex constructor i am receiving the custom date value as below.
customDate = Date.valueOf(ApexPages.currentPage().getParameters().get('oppDate'));
But I am receiving error as
"Argument cannot be null. An unexpected error has occurred. Your development organization has been notified. "
How to pass the oppDate from url to constructor.
Try this
/apex/vfpage?oliId={!OpportunityLineItem.Id}&oppDate={!Opportunity.customDate__c}
In url u have used "&&", It should be "&". Like this:
/apex/vfpage?oliId={!OpportunityLineItem.Id} & oppDate={!Opportunity.customDate__c}
try this.
If it will not work then convert Date to String and pass in url. And while receving again convert to Date.
Thanks
Niraj
It seems you have a space between the query string,
url should be like this,
/apex/vfpage?oliId={!OpportunityLineItem.Id}&&oppDate={!Opportunity.customDate__c}
and inside the controller try like below,
regards
This URL is to be something like this
/apex/vfpage?oliId={!OpportunityLineItem.Id}&oppDate={!Opportunity.customDate__c}