3

EDIT:

enter image description here I have overridden the New button in Case object and opening a Visualforce page but if I open the page using preview VFP I'm not getting the error and its happening only when I click on NEW button.

I have looked at this question but did not help me fix the issue i'm having.

Visualforce page:

<apex:page standardcontroller="Case" extensions="caseExt" action="{!redirectPage}">
<apex:form id="form">
    ......
    ......

    </apex:form>
</apex:page>

Controller:

public PageReference redirectPage() 
{
  PageReference page = new PageReference('/' + Case.SObjectType.getDescribe().getKeyPrefix() + '/e');
  Map<String, String> param = p.getParameters();
  param.putAll(ApexPages.currentPage().getParameters());                       
  param.put('nooverride', '1');                        
  page.setRedirect(true);
  return page;

}

Error: Invalid Data.
Review all error messages below to correct your data. The page you submitted was invalid for your session. Please click Save again to confirm your change.

6
  • Security Controls > Session Settings this should solve your issue ?
    – Ratan Paul
    Commented Mar 30, 2016 at 2:47
  • nope it did not solve my issue
    – Nick
    Commented Mar 30, 2016 at 3:11
  • Try removing the line param.putAll(ApexPages.currentPage().getParameters());
    – Jenny B
    Commented Mar 30, 2016 at 4:19
  • Not sure which parameter is causing the issue but I remember someone else running into this issue before.
    – Jenny B
    Commented Mar 30, 2016 at 16:40
  • Saw your comment on my question from yesterday, but it looks like Jenny has figured it out already. What you need to do now is review all the parameters you are getting from the current page using ApexPages.currentPage().getParameters() - using debug logs with system.debug() is how I would check that.
    – smohyee
    Commented Mar 30, 2016 at 17:59

1 Answer 1

4

The problem is with this line here param.putAll(ApexPages.currentPage().getParameters()); and in particular with the save_new parameter that is being added to the URL causing the error. Similar issue here, Error while PrePopulating Name in Opportunity

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .