Skip to main content
added 4 characters in body
Source Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

public class myController {

    public List<SelectOption> opts             {get;set;}
    private String oType                        {get;set;}
    public Id recTypeId                         {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
        opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
        opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
            mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});


        return opts;
    }
}

Edit to add Visual Force Page Code:

<apex:page standardController="Account"> 
   <apex:form > 
      <apex:selectList value="{!recTypeID}" size="1"> 
         <apex:selectOptions value="{!myOptions}">
         </apex:selectOptions> 
      </apex:selectList> 
      <apex:commandButton value="Next" Action="{!continue}"/> 
   </apex:form> 
</apex:page>

Can someone help me with this? Thanks!

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

    public List<SelectOption> opts             {get;set;}
    private String oType                        {get;set;}
    public Id recTypeId                         {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
        opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
        opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
            mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});


        return opts;
    }
}

Edit to add Visual Force Page Code:

<apex:page standardController="Account"> 
   <apex:form > 
      <apex:selectList value="{!recTypeID}" size="1"> 
         <apex:selectOptions value="{!myOptions}">
         </apex:selectOptions> 
      </apex:selectList> 
      <apex:commandButton value="Next" Action="{!continue}"/> 
   </apex:form> 
</apex:page>

Can someone help me with this? Thanks!

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

    public List<SelectOption> opts             {get;set;}
    private String oType                        {get;set;}
    public Id recTypeId                         {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
        opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
        opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
            mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});


        return opts;
    }
}

Edit to add Visual Force Page Code:

<apex:page standardController="Account"> 
   <apex:form > 
      <apex:selectList value="{!recTypeID}" size="1"> 
         <apex:selectOptions value="{!myOptions}">
         </apex:selectOptions> 
      </apex:selectList> 
      <apex:commandButton value="Next" Action="{!continue}"/> 
   </apex:form> 
</apex:page>

Can someone help me with this? Thanks!

Pasted in VF code from his comments below my Answer
Source Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

    public List<SelectOption> opts             {get;set;}
    private String oType                        {get;set;}
    public Id recTypeId                         {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
        opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
        opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
            mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});


        return opts;
    }
}

Edit to add Visual Force Page Code:

<apex:page standardController="Account"> 
   <apex:form > 
      <apex:selectList value="{!recTypeID}" size="1"> 
         <apex:selectOptions value="{!myOptions}">
         </apex:selectOptions> 
      </apex:selectList> 
      <apex:commandButton value="Next" Action="{!continue}"/> 
   </apex:form> 
</apex:page>

Can someone help me with this? Thanks!

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

    public List<SelectOption> opts             {get;set;}
    private String oType                        {get;set;}
    public Id recTypeId                         {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
        opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
        opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
            mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});


        return opts;
    }
}

Can someone help me with this? Thanks!

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

    public List<SelectOption> opts             {get;set;}
    private String oType                        {get;set;}
    public Id recTypeId                         {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
        opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
        opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
            mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});


        return opts;
    }
}

Edit to add Visual Force Page Code:

<apex:page standardController="Account"> 
   <apex:form > 
      <apex:selectList value="{!recTypeID}" size="1"> 
         <apex:selectOptions value="{!myOptions}">
         </apex:selectOptions> 
      </apex:selectList> 
      <apex:commandButton value="Next" Action="{!continue}"/> 
   </apex:form> 
</apex:page>

Can someone help me with this? Thanks!

added 49 characters in body
Source Link

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

public class myController {

 public list<SelectOption>List<SelectOption> getRecordTypes()

{
opts    list<SelectOption> options = new list<SelectOption>();
    for(RecordType sRecordType{get;set;}
 : [Select Id, DeveloperName,private NameString FromoType RecordType Where SObjectType = 'Opportunity']){
   
         Map<String,List<String>> mapping = new Map<String,List<String>>();
    {get;set;}
    mapping.put('Small_Medium_Sized_Business',public newId List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});
recTypeId       
      List<RecordType> rTypeList = [Select Id, DeveloperName, Name
       {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
     From RecordType
  opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity''Opportunity']) and{
 DeveloperName       opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
           IN :mapping.getput(currentAccount.RecordType.DeveloperName'Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'})];;


    }
    return options;opts;
    }
}

Can someone help me with this? Thanks!

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

public list<SelectOption> getRecordTypes()

{
    list<SelectOption> options = new list<SelectOption>();
    for(RecordType sRecordType : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']){
   
         Map<String,List<String>> mapping = new Map<String,List<String>>();
        mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});
       
      List<RecordType> rTypeList = [Select Id, DeveloperName, Name
                                   From RecordType
                                   Where SObjectType = 'Opportunity' and DeveloperName
                                   IN :mapping.get(currentAccount.RecordType.DeveloperName)];
    }
    return options;
}
}

Can someone help me with this? Thanks!

I'm trying to create a visualforce page which clones the record type selection page when creating new Opportunities. I'd like the page to display opp record types based on the related account record type. Below is the code but I'm getting error this error:

Variable does not exist:currentAccount.RecordType.DeveloperName

public class myController {

    public List<SelectOption> opts             {get;set;}
    private String oType                        {get;set;}
    public Id recTypeId                         {get;set;}

    myController(){
        oType = 'Opportunity';
    }

    public List<SelectOption> myOptions() {
        opts = new List<SelectOption>();

        opts.add(new SelectOption('','--Please Select Record Type --'));

        for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
        opts.add(new SelectOption(rts.id,rts.name));
        }

            Map<String,List<String>> mapping = new Map<String,List<String>>();
            mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});


        return opts;
    }
}

Can someone help me with this? Thanks!

added controller tags
Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116
Loading
added 31 characters in body
Source Link
Sergej Utko
  • 22.1k
  • 11
  • 60
  • 88
Loading
Source Link
Loading