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
Hari nadh babu Eluru 7Hari nadh babu Eluru 7 

result was not getting in another page

VF code Page1
<apex:page controller="M_R_Another">
<apex:form >
<apex:pageBlock title="Recently Modified">
<apex:commandButton value="Click Me" action="{!RM}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex code Page 1
public class M_R_Another {

    public PageReference RM() {
        PageReference pageRef = new PageReference('https://93com4-dev-ed--c.visualforce.com/apex/M_R_Another2?mrp='+RM);
        return pageRef;
    }

}
VF Code Page 2
<apex:page controller="M_R_Another2">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!n}" var="g">
                <apex:column value="{!g.Name}"/>
                <apex:column value="{!g.LastModifiedDate}"/>
                <apex:column value="{!g.Student_Id__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex code Page 2
public class M_R_Another2 {

    public list<Student__c> n { get; set; }
    
    public M_R_Another2(){
        string m = ApexPages.currentPage().getParameters().get('mrp');
        n = [SELECT Student_Id__c,Name, LastModifiedDate FROM Student__c  ORDER BY LastModifiedDate DESC];
    }
}
And also getting Error below image is the error getting in page 1
error



 
Best Answer chosen by Hari nadh babu Eluru 7
mukesh guptamukesh gupta
Hi HAri,

Apex Code Page 1
 
public class M_R_Another {

    public PageReference RM() {

       Decimal mrpVal = 10;
        PageReference pageRef = new PageReference('https://93com4-dev-ed--c.visualforce.com/apex/M_R_Another2?mrp='+mrpVal);
        return pageRef;
    }

}

Apex Code Page 2:- 
 
public class M_R_Another2 {

    public list<Student__c> n { get; set; }
    
    public M_R_Another2(){
        Decimal mrp  = ApexPages.currentPage().getParameters().get('mrp');
        n = [SELECT Student_Id__c,Name, LastModifiedDate FROM Student__c  ORDER BY LastModifiedDate DESC];
    }
}

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh