I have been struggling since last few days to resolve this which seems to me should not be an issue.
I have a button on Opportunity page named New Proposal and calling a VF page. This VF page shows the quote list and user is allowed to select and click generate button on this page. The new page render as PDF and has few query strings to use in constructor where I am fetching Opportunity detail.
If I use the QueryString variable and use as below in SOQL, it gives the error of List has no rows for assignment to SObject
String StrId = (String)ApexPages.currentPage().getParameters().get('id');
Opportunity oPData =[
SELECT
Id,Name, account.name, Owner.Name,
Physical_Address_Street__c, Physical_Address_City__c,
Physical_Address_State__c, Physical_Address_Zip__c,
First_Name__c, Last_Name__C
FROM Opportunity WHERE id = :StrId
];
If I use a hardcoded value as below, it works fine. Would appreciate any help here.
String StrId = '0064B000002jHAs';
id
parameter in the URL for this page? Is your button correctly passing the ID of the record along to the VF page?