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
Dhana t 1Dhana t 1 

when vf page is open record will be saved?????

I Have a requirement that when we open a vf page automatically record will be saved in sobjects like account or contact without entering the data, we can write controllers for that,, plz share your idea.....?

Thank you..
KaranrajKaranraj
Use 'action' attribute in the visualforce page tag. You need to mention the controller method name in the action attribute, which will call that method when the page loads.
<apex:page action="{!doAction}">
doAction is the your controller method name.

The action method invoked when this page is requested by the server. Use expression language to reference an action method. For example, action="{!doAction}" references the doAction() method in the controller. If an action is not specified, the page loads as usual. If the action method returns null, the page simply refreshes. This method will be called before the page is rendered and allows you to optionally redirect the user to another page. This action should not be used for initialization.
Dhana t 1Dhana t 1
thank you ...!

can you give me a related exapmple with code?