Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6982231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:15:38+00:00 2026-05-27T18:15:38+00:00

I am trying to build a visual force page, where you select an opportunity,

  • 0

I am trying to build a visual force page, where you select an opportunity, and then you select stages associated with that opportunity. Opportunities are saved in the table RecordTypes, and Stages are saved in the table OpportunityStage.

In what table is the relationship saved?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:15:39+00:00Added an answer on May 27, 2026 at 6:15 pm

    RecordTypes aren’t a table, they’re literally a set of types defined for a specific object, so that any record of that object (for example any Opportunity) can have one of those types. It’s basically a super special field on the object which is used to drive a whole heap of behaviours — you can have different page layouts for each record type, different picklist values, you could customise validation rules etc..

    Stages again are a ‘special’ part of Salesforce configuration as they belong to the Sales process, and I believe the values available depend on the record type (i.e. they act just like a picklist).

    Long story short, you don’t need to worry about any relationship for these fields, in database terms they’re columns on the opportunity table, in SFDC terms they’re fields on the Opportunity object.

    Edit
    Following clarification of the requirements, i.e needing the available stage names for two opportunities.

    There are easy to get using Visualforce without any describe information.

    Ensure your sales processes are defined and linked to appropriate record types for the Opportunities (sounds like this has already been done). Next, simply load the required opportunities using a custom controller (or controller extension) — you could specify them via page parameters as below, though this is a contrived example and does not include any error handling etc. (or opportunity selection):

    public with sharing class DualOpptyController
    {
        public Opportunity oppty1 {get; set;}
        public Opportunity oppty2 {get; set;}
    
        public DualOpptyController()
        {
            oppty1 = [select Id, StageName from Opportunity where id = : ApexPages.currentPage().getParameters().get('o1')];
            oppty2 = [select Id, StageName from Opportunity where id = : ApexPages.currentPage().getParameters().get('o2')];
        }
    }
    

    Then simply use <apex:inputField> to put the StageName field onto the page:

    <apex:page controller="DualOpptyController">
        <apex:form >
            <apex:inputField value="{!oppty1.StageName}"/>
            <apex:inputField value="{!oppty2.StageName}"/>
        </apex:form>
    </apex:page>
    

    When you want to do your search for accounts, you can just use the StageName field on both oppty and oppty2 in your controller. The query will be something like the following (untested):

    [Select Id, Name, (select Id, Name from Opportunities where StageName in : liStageNames) from Account]
    

    The problem with this of course, is that it’ll return ALL accounts so I think you’d be better off searching on Opportunity where StageName equals that of oppty1 returning the relavant details and also associated account ID. then do a second query to find opportunities where StageName equals that of oppty1 and the account id is in the set of account IDs located in the first query. You’re still likely to run into issues with returning too many records, so you may find a way to refine this method or you could specify other parameters as well (for example, opportunities closing this month).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a solution that I am trying to build in Visual Studio which
I was trying to build a C# solution on my Visual Studio 2008, that
I'm trying to build a macro for Visual Studio 2008 that behaves thusly: (Extract
I'm trying to build an application so that the user can see table entries
I'm trying to build a ribbon app in visual studio and I got that
I am trying to build the Intellesoft BugTrap source using Visual Studio 2008. I
I'm trying to build firefox but I'm having some problems. I currently have Visual
I am trying to build a SharePoint 2007 web part in Visual Studio. This
Anyone ever had this error when trying to build a solution in Visual Studio
In Visual Studio (C++) the other day, I was trying to build some example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.