+ Start a Discussion
jkirschjkirsch 

Defaulting to a specific record type.

I'm creating a visualforce page that will direct a user from a site to a contact, but have multiple contact record types.  Is there a way I can determine which record type is correct for the user in the visual force?  Or is there a way to ask them before the record is created?  Right now I have:

 

       public void pageredir(){
 
       String URL='/003/e';
        URL=URL+'?retURL=/'+s.id;
        URL=URL+'&nooverride=1';
        URL=URL+'&RecordType=012700000005IBE';
        URL=URL+'&what_id='+s.id;
        URL=URL+'&con4_lkid='+smAcctid ;

 

Thank you.

S_LieS_Lie

I dont really get your question, can you explain more bout what are you trying to achieve ?

 

 

finalistfinalist

I have an org with 6 record types for Opportunities, and I want to override the standard page for creating or editing the Opportunity for some of these record types.  If the record is being edited, then the RecordTypeId is passed in as a parameter.

 

If this is a new record, and the User has access to more than one record type, then the RecordTypeId is passed as a parameter after the User has selected the record type they'd like to use.

 

If the User's profile only allows them to have access to a single Opportunity record type, then no RecordTypeId parameter is passed (why..?).  

 

I've looked at the RecordTypeInfos definition but I'm not really looking for the list of record types associated to Opportunity; I want to know the one record type that the User has access to.

 

Does anyone have an example/description of how you identify the current user's (only) record type for a given SObject?