function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Admin 2467Admin 2467 

How to create custom controller on custom object?

i have a custom object "program" and there have a custom object "Receipt" under the "program". (For the customer register the program)

Now i am create a VF page that gain the "program" and "receiprt" data and generate the PDF Form.

At the begining, i use the standard controller and everything fine. But after i found a logic bug that the standard controller is get all data on "Program" and "Receipt" Tablet. 

The problem is "Receipt" table have the status field to decide the receiprt status "Normal" and "Cancel". And the standard controller will 
get all the data whihc is no matter is cancel status.

Please advise how to create an custom controller with condition contorl. Thanks.

ANUTEJANUTEJ (Salesforce Developers) 
Hi there,

I think you should be able to get only a specific set of records using a filter on the soql query.

Please let me know if there is any specific usecase,.

Regards,
Anutej