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
gv007gv007 

Action binding method with out using <apex:page> tag

I have a issue ,when am working with <apex:page action="{Method}">.

 

In my application I have a situation , action method invoked when a object(SObject now) page is requested by the server. Using <apex:page action="{Method}"> because of  Spring 09 release issues it is not working now.

 

Their is any other options available for action binding ,when a sobject page is requested.

Message Edited by gv007 on 02-11-2009 12:03 PM
Message Edited by gv007 on 02-11-2009 01:43 PM
JimRaeJimRae

Not sure what issue you are experiencing related to the Spring release, I have an action in several of my page tags, and it still works fine. 

I can think of two other possible ways you could bind an action to your page load.

One, use an actionFunction to provide access to your method from javascript, then add an onload javascript function that calls the method.

 

Two, if you are using a custom controller, which I guess you are, you could execute the method in the constructor of your controller class.

gv007gv007

Jim,

      Thanks for replying second solution it won't work I already tried because I have DML operation in my function it is returning the Sytem.exception.

 

In yours methods you have DML operation?If you have you will get the following error.

 

Invalid root component None found in view apex:VF Page will try using action function. If possible can you post some snippet code using actionFunction.

 

<apex:page action="{Method}" >//Here am binding my function it contains DML operations. And am using a custom controller ..... </apex:page>

 

JimRaeJimRae

I have SOQL Selects in my action, but no other DML (I am assuming you are trying to insert, delete or update).

I don't have any code samples for the actionfunction, I just recalled reading that is something you could do.

This sounds like a bug, I would recommend you open a case with support about it.

gv007gv007

Yes am doing insert operation already opened a case waiting for response.Salesforce.com team is working around it.

yibongleeyibonglee

try to change this

 

<apex:page action="{Method}">

to this...

 

<apex:page action="{!Method}">

 

 I think you were missing "!" ...

 

 

 

 

 

gv007gv007

It is a pseudo code see my post.It is a Spring 09 release issue they fixed it.