• mluedtke
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Have a standard object layout that includes a visualforce page. With in the visualforce page there is a  apex:commandLink, the action for the commandLink is point to a function of a pageReference. If validation false the error message gets load to apex:pageMessages. The issue we are having is the pageReference is causing the visualforce page redirect out of the standard object layout. We do not want this behaviour! We want the error message to display within the standard object layout or even better in the visualforce page with in the standard object layout. FYI --> PageReference returns Null.

 

Also we try pointing back to the standard object layout but we lost the error messages when return to the standard object.

 

Any ideas why this is happening?

 

 

Code from the extensions of the VF page:

 

Public PageReference Name() {

    PageReference pageRef = null;

    .......

 

    if (ApexPages.hasMessages(ApexPages.Severity.Error))    {
             Database.rollback(sp);
    }

    return pageRef;

 

}

 

Page Code

 

 <apex:page standardController="standardController" extensions="extensions" >
     <apex:pageBlock >
        <apex:pageMessages />
        <apex:actionRegion >
        <apex:form id="theform" >

           ............

         <apex:commandLink action="action" value="Value" target="_top" />

 

 

Have a standard object layout that includes a visualforce page. With in the visualforce page there is a  apex:commandLink, the action for the commandLink is point to a function of a pageReference. If validation false the error message gets load to apex:pageMessages. The issue we are having is the pageReference is causing the visualforce page redirect out of the standard object layout. We do not want this behaviour! We want the error message to display within the standard object layout or even better in the visualforce page with in the standard object layout. FYI --> PageReference returns Null.

 

Also we try pointing back to the standard object layout but we lost the error messages when return to the standard object.

 

Any ideas why this is happening?

 

 

Code from the extensions of the VF page:

 

Public PageReference Name() {

    PageReference pageRef = null;

    .......

 

    if (ApexPages.hasMessages(ApexPages.Severity.Error))    {
             Database.rollback(sp);
    }

    return pageRef;

 

}

 

Page Code

 

 <apex:page standardController="standardController" extensions="extensions" >
     <apex:pageBlock >
        <apex:pageMessages />
        <apex:actionRegion >
        <apex:form id="theform" >

           ............

         <apex:commandLink action="action" value="Value" target="_top" />