+ Start a Discussion
srinu jsrinu j 

While visulaforce page is loading....

While visualforce page is loading, automatically 10 records have to insert into the particual object that you specify. How do I have to ahcieve this?
Best Answer chosen by srinu j
Chandra Prakash PandeyChandra Prakash Pandey
Hi srinu,

You can do this in the constructor of controller class or in action property of apex:page tage you can call your any controller function which will contain the logic to insert records and it will execute before the page renders.

Go through the given link to understand the order of execution for VF Page:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_get_request.htm

Let me know, if it helps.

Regards,
Chandra Prakash