May 2019
Intermediate to advanced
546 pages
12h 41m
English
The second type of controller actions are getters. You've already learned about the principal of the getter variable in this chapter. When you use a getter, you are able to define a method as well, and get the value of that variable so that you can call the variable of your getter method in your page. The name of this method needs to start with the word get and the name of the variable.
The following piece of code will help us get the value of a movie in the Movie variable:
public Movie__c getTheMovie() { if (this.movieId != null){ // select the movie and the cast from the Id. // We always select records with a list, even if you know it should be a record. // if someone removes the record while you want to select it, you will ...Read now
Unlock full access