• Carla Cook
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
 I have a button that initiates this url: ....../apex/VSPageStandardControllerPagePainting?engId={!Engagement__c.Id }
 
In my Visualforce page,  how to I capture the engId so I can then use it in the code?    I think I use the following in some way,  but how?
 
 What is the complete code syntax?  
 
System.currentPageReference().getParameters().get('engId')
 
Your help is greatly appreciated.
Hi Team,

I've asked similar question, but answer did not solve issue.  Is this an order of execution thing or something like that???
See below,  where I tried by ultimate goal of condition based on RecordType.Name,  even tried  a simple IF (1=2)  and I still get ALL of the selectOption displayed.

What is the proper technique for this????
Thanks.

I am using this...
<apex:page standardController="MyCustom__c" sidebar="false">
.....
 <apex:form >
....
<apex:pageBlockSection title="Build PickList">
......
<apex:selectList >
    { ! IF (1=2)
    {
     <apex:selectOption itemLabel="1=1" itemValue="1=1"/>
    }
    }
.....
ultimate goal is this conditional,  but even the IF (1=2) does not seem to execute properly
I DO get the MyCustom__c.RecordType.Name A-OK.
However,  the IF seems to fail,  because I get ALL THREE selectOption displayed every time.

{ !IF 
           (CONTAINS (MyCustom__c.RecordType.Name,"Hiring"),
           {
           <apex:selectOption itemLabel="Initial Contact for Hiring Need" itemValue="Initial Contact"/>
           <apex:selectOption itemLabel="Follow-up Contact for Hiring Need" itemValue="Followup Contact"/>}
           , 
           
           {  <apex:selectOption itemLabel="NOT Hiring Need" itemValue="NOT Hiring Need"/>}
           )
        } 

  </apex:selectList>


 
How can I build a selectList with selectOption based on field content?  And, in general,  how can IF's be added to Visual Force code?

<apex:selectList >
If RecordType.Name contains Hiring,  I'd like TWO selectOption statements,  if Name does not contain Hiring,  I'd like a different selectOption statement.

When I execute the code below, ALL three selectOption statements execute every time.
Here's the code....
<apex:selectList> 

{ !IF (CONTAINS ({!Engagement__c.RecordType.Name},"Hiring"), <apex:selectOption itemLabel="Initial Contact for Hiring Need" itemValue="Initial Contact"/>
<apex:selectOption itemLabel="Follow-up Contact for Hiring Need" itemValue="Followup Contact"/>,
<apex:selectOption itemLabel="NOT Hiring Need" itemValue="NOT Hiring Need"/> ) }
</apex:selectList> 
 
 I have a button that initiates this url: ....../apex/VSPageStandardControllerPagePainting?engId={!Engagement__c.Id }
 
In my Visualforce page,  how to I capture the engId so I can then use it in the code?    I think I use the following in some way,  but how?
 
 What is the complete code syntax?  
 
System.currentPageReference().getParameters().get('engId')
 
Your help is greatly appreciated.
Hi Team,

I've asked similar question, but answer did not solve issue.  Is this an order of execution thing or something like that???
See below,  where I tried by ultimate goal of condition based on RecordType.Name,  even tried  a simple IF (1=2)  and I still get ALL of the selectOption displayed.

What is the proper technique for this????
Thanks.

I am using this...
<apex:page standardController="MyCustom__c" sidebar="false">
.....
 <apex:form >
....
<apex:pageBlockSection title="Build PickList">
......
<apex:selectList >
    { ! IF (1=2)
    {
     <apex:selectOption itemLabel="1=1" itemValue="1=1"/>
    }
    }
.....
ultimate goal is this conditional,  but even the IF (1=2) does not seem to execute properly
I DO get the MyCustom__c.RecordType.Name A-OK.
However,  the IF seems to fail,  because I get ALL THREE selectOption displayed every time.

{ !IF 
           (CONTAINS (MyCustom__c.RecordType.Name,"Hiring"),
           {
           <apex:selectOption itemLabel="Initial Contact for Hiring Need" itemValue="Initial Contact"/>
           <apex:selectOption itemLabel="Follow-up Contact for Hiring Need" itemValue="Followup Contact"/>}
           , 
           
           {  <apex:selectOption itemLabel="NOT Hiring Need" itemValue="NOT Hiring Need"/>}
           )
        } 

  </apex:selectList>