+ Start a Discussion
gv007gv007 

The page you submitted was invalid for your session.

The page you submitted was invalid for your session. Please click Save again to confirm your change.

 

 

Description; In this case am calling an VF page in a section in that page am calling commandlink and outputlinks .it is working fine when it is uinmanaged packege but it failing after making packaged application i checked the name space it is fine in all the palce .Any body know about this issue please posst some clue to track it.

OCDGeekOCDGeek

I'm having a similar issue with a managed package. Any time the page is refreshed I get the error. I'm using Apex rerender parameter, so it looks like it is related to the Ajax call.

 

This is not new code and has been working for months, but started seeing the issue about a week ago.

 

 

gv007gv007
Can you the lin eof code where u are geting the error it will helpful to me to track it
OCDGeekOCDGeek

Visualforce page: RefreshTest (to be used in a section on the Contact Detail page layout)

 

<apex:page standardController="Contact" extensions="RefreshTest" showHeader="false" standardStylesheets="true">

    <apex:form >

        <apex:outputPanel id="panel">

            <apex:commandLink id="refreshLink" action="{!refresh}" value="refresh" status="refresh" rerender="panel" />

            <apex:actionStatus id="refresh" startText="refreshing..." layout="block" />

        </apex:outputPanel>

    </apex:form>

</apex:page> 

 

Apex class: RefreshTest

 

public with sharing class RefreshTest {

    public String aVariable;

    

    public RefreshTest() {

        aVariable = 'var';

    }

    

    public RefreshTest(ApexPages.StandardController stdController) {

        aVariable = 'var';

    }

    

    public PageReference refresh() {

        return null;

    }

} 

 

Add the VF page as a section in the Contact page layout, view any Contact, then click the Refresh link. The error appears.

 

OCDGeekOCDGeek

I'm interested to know which server your org is on. I have a development org on na6 that does not exhibit the behavior with the code above and one on na7 which does.

 

Can you list any servers where you are having this issue? 

gv007gv007

Geek,

         I am using na6 and na7 am geting the problem after making an beta managed release .that the action function in commandlink is not working properly.If ures na6 is working fine means that account is opned before summer rlease (I am right .In my case alos  it is working fine in na6 if the account is opned before summer release .) Did u tested yours code in latest developers account.

Regarding this i filled a case with salesforce.com people.I am excepting it is an salesforce.com because the same type or bug we got in winter release it happned in apex:page action property right now it was hitting in commandlink .I will look yous code once i will let u know i found anything.

OCDGeekOCDGeek

Yes, the na6 org that is working was created prior to the Summer '09 release, and the one that is not working was created after the release. Thanks for that info.

 

I too have a ticket open with Salesforce about the issue. I will add this information to that ticket.

gv007gv007

For this bug they need to fix the action proprty or we need to see other alternative VF tags.Just working on it if it works fine let u know. 

Thanks

Regards

Gopi

 

gv007gv007

<apex:commandButton id="xyz" value="ButtonName" onclick="methodOneInJavascript('Yes!')"> <apex:actionFunction action="{!function}" name="methodOneInJavascript"/>

 

try it .another alternative.

OCDGeekOCDGeek

Yes, this also exhibits the error behavior in the same orgs as the previous example.

 

Have you heard anything from Salesforce support on your ticket? I have received no response. 

gv007gv007
I did't received anything from them.this thing I did't tested in new accounts .I  tested old SF account Thanks for info.
OCDGeekOCDGeek

Salesforce support has resolved the issue for my two orgs that were exhibiting the error.

 

The following permissions need to be set for any org with the problem:

  • Validate CSRF Token on GET
  • Validate CSRF Token on POST

 

I'm waiting for the bug number, but figured this might help until I receive it. 

gv007gv007
Thanks I will try it.
gv007gv007

Geek,

         Can you post some sample code how did you implemented

  • Validate CSRF Token on POST aam trying to figure out it in documentation.
OCDGeekOCDGeek

Sorry, was on vacation last week.

 

There is no code to post. This is a change that needs to be performed by Salesforce Support. It is a change to the permissions at the Org level.

 

You'll need to put in a request with SF Support to have the change made to your Org.

 

gv007gv007
Ok.Thanks Geek.
OCDGeekOCDGeek

More information on this issue.

 

When contacting Salesforce support, reference the following Salesforce bug numbers:

W-647529
W-647552

sureshpdnsureshpdn

>>The page you submitted was invalid for your session. Please click Save again to confirm your change.

 

I could resolve this error for managed package by 'setRedirect(true)' my PageReference action.

 

 

 PageReference ex = new PageReference('/apex/example');

 

 ex.setRedirect(true);// without this line error occured,now fixed with this line


 return ex;

 

 

 -suresh

gv007gv007

Suresh, 

How you are producing this error message.Can you post some sample code.

 

 

 

 

gv007gv007

Suresh,

            I believe we and you are working in different scenario ,I tried with yours code but it is failing if you post yours code i will track what going on .

sureshpdnsureshpdn

My scenario somewhat complex I will explain the scenario using following steps


(1)I have page called 'setup' .This page has Two page blocks for two task. I have overwrite save method

</apex:pageBlockSection>
        <apex:pageBlockButtons location="top">
            <apex:commandButton action="{!save}" value="Edit" ></apex:commandButton>
            <INPUT TYPE="hidden" NAME="s" VALUE="e"/>
        </apex:pageBlockButtons>   
    </apex:pageBlock>
 </apex:form>
 
 
 (2)public PageReference save() {
        String btype= ApexPages.currentPage().getParameters().get('s');
   
        if(methodParam == 'paramEdit'){
            methodParam = '';
            return editAccount();
        }lse if(btype== 'e'){//task for Edit
            return editTax();
        }else if(btype== 'n'){
            return newAccount();
        }else if(btype== 's'){
            return editSerial();
        }else if(btype== 't'){
            return saveTax();
        }else if(btype== 'ss'){
            return saveSerial();
        }
       

        return null;
    }
   

(3)After click edit button this action occurred and change page to setup --> mergeSettings
    public PageReference editTax() {
        PageReference orgDetailEditPage= new PageReference('/apex/mergeSettings');
        orgDetailEditPage.setRedirect(true);
        return orgDetailEditPage;
    }
   
   
(4)     In mergeSettings page press save button. here return ( return saveTax());

<apex:pageBlockButtons location="top">
       
        <apex:commandButton action="{!save}" value="Save"/>
        <apex:commandButton value="Cancel" />               
        <INPUT TYPE="hidden" NAME="s" VALUE="t"/> //return saveTax();
          
    </apex:pageBlockButtons>
    </apex:pageBlock>                  
</apex:form>

(5)When error occurred this PageReference action return to setup page without 'setup.setRedirect(true)'


saveTax()

    public PageReference saveTax() {
        try {
           MergeSetting__c orgDetails = getOrganizationDetail();
           OrgData od = getOrgData();
           if(orgDetails==null ){
              orgDetails = new MergeSetting__c();
              orgDetails.TaxRate__c = od.getTaxRate();

              insert orgDetails;
           }else{
             orgDetails.TaxRate__c = od.getTaxRate();
             update orgDetails;            
           }
        } catch (Exception e) {
          
        }
        PageReference setup= new PageReference('/apex/setup');
        setup.setRedirect(true); //without this line error was generated.
        return setup;
   }
  
 (6)Still error was not occurred ,then press on other PageReference button (here 'New') or link. you can generate the error.

<apex:pageBlockButtons location="top">
              <INPUT TYPE="hidden" NAME="s" VALUE="n"/>
              <apex:commandButton value="New" action="{!save}"></apex:commandButton>
          </apex:pageBlockButtons>            
         
     </apex:pageBlock>
 
  </apex:form>


NOTE:(Error occurred only managedpackage when you are normally it works for development process)
STEPS
(1)GO 'setup'                               

                    URL='https://opro.ap1.visual.force.com/apex/setup'                     ---ok
(2)PRESS 'Edit'  then  setup page change to   'mergeSettings'  

                    URL='https://opro.ap1.visual.force.com/apex/mergeSettings'      ---ok
(3)PRESS 'Save'  then  mergeSettings page change to   'setup' But 

                    URL='https://opro.ap1.visual.force.com/apex/mergeSettings'      ---Not ok(for Managedpackage)
(4)PRESS 'New'   then  Error occurred.
  
After do  'setRedirect(true)'  STEPS
(1)GO 'setup'                       

                    URL='https://opro.ap1.visual.force.com/apex/setup'                     ---ok
(2)PRESS 'Edit'  then  setup page change to   'mergeSettings'  

                    URL='https://opro.ap1.visual.force.com/apex/mergeSettings'      ---ok
(3)PRESS 'Save'  then  mergeSettings page change to   'setup' Now 

                    URL='https://opro.ap1.visual.force.com/apex/setup'                     ---ok(for Managedpackage)
(4)PRESS 'New'   then  Load the relevent Page.
   
-Suresh  

hisalesforcehisalesforce
Check the commandlink.If commandlink action has been callled and method return is PageReference.So remove rerender from Commandlink that should be solving the issues.
<!----------------------------------------------------------------->
<apex:commandLink id="refreshLink" action="{!refresh}" value="refresh" status="refresh" rerender="panel" />

public PageReference refresh() {
        return null;
    }

We have two options to solve the issues:
1. Remove the rerender from the page.
2. Change the method refresh to  void method.