• mickbiden mickbiden
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello erveryone,

I´m currently learning about the Wizard development with Visual force.
For this i´m using the Visualforce Developer Guide. But i´m stuck at this session: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_controller_getter_methods.htm
This is the error i get: System.QueryException: List has no rows for assignment to SObject
Class.MyController.getAccount: line 8, column 1

Apperently this means, that the querry in my controller returned nothing but i don´t know why since my code and makrup is identicle with the guid.

This ist the markup:
<apex:page controller="MyController" tabStyle="Account">
  <apex:pageBlock title="Hello {!$User.FirstName}!">
      This is your new page for the {!name} controller. <br/>
      You are viewing the {!account.name} account.
  </apex:pageBlock>
</apex:page>

This is the controller:
public class MyController {
    
    public string getName() {
        return 'MyController';
    }
    
    public Account getAccount() {
         return [select id, name from Account 
                 where id = :ApexPages.currentPage().getParameters().get('id')];
   }
}