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

How can i get the information from apex controller to visualforcepage ?

I want to go straight to a solution record type without being need to select the record type. When i check the url i see that opp name it is different than the one from where i started the solution.

Here is my visualforcepage
<apex:page standardController="Solutions__c" recordSetVar="solutions" extensions="SolutionWrapper" >
            function redirect(){
            window.onload = window.setTimeout(redirect(),5000);


Controller :

public with sharing class SolutionWrapper {
    public Opportunity opp{get; set;}
    public Solutions__c oppId{get; set;}
    public Solutions__c sol{get; set;}
    public Solutions__c solution{get; set;}
    public Account acc{get; set;}
    public SolutionWrapper(ApexPages.StandardSetController controller) {
            solution = new Solutions__c();
            solution = (Solutions__c)controller.getRecord();
            if(solution.Id != null){
                oppId = [SELECT id, Solutions__c.Opportunity__c,Mail_Merge_Id__c
                    FROM Solutions__c
                WHERE id =:
                OR Mail_Merge_Id__c =: solution.Mail_Merge_Id__c 
                LIMIT 1];
                opp = [Select id,Name, AccountId, CurrencyIsoCode  from 
                         Opportunity where id =: oppId.Opportunity__c  LIMIT: 1];
            if( !=null){
                sol = [SELECT id,Name, Mail_Merge_Id__c,Solution_Country__c, Solutions__c.Opportunity__c 
            FROM Solutions__c
            WHERE Solutions__c.Opportunity__c =:
            LIMIT 1];
                 acc = [Select id,Name,Country__c from 
                         Account where id=:opp.AccountId LIMIT: 1];
        catch(Exception e){
            ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.ERROR,e.getMessage()));


Jay GuruswamyJay Guruswamy

if you are talking about , how to bring OppId to VF Page from Controller, it can be done by



Also I notice in the url


I think you should be using 


by the way , a better way to redirect from vf page to different page is as below.

public PageReference GoToURL{
//Your logic here to fram url string.
PageReference retURL = new PageReference('REDIRECT URL');
return retURL;

and call this pagereference from your <apex: page tag as below

<apex:page ....other parameters here---       action="{!GoToURL}">

Hope this helpw.