I need to display text based on record type & has teammember.But it displays both messages regardless of record type.Below is the part of my visualforce page.
<apex:outputLabel style="color:red;"
rendered="{!IF(HasTeamMember && ENT_ED_LIHTC__c.recordtype.name =='Standard Deal', false, true)}" >
Note: At least one Team Member with Role as Originator is required.<br/><br/>
</apex:outputLabel>
<apex:outputLabel style="color:red;"
rendered="{!IF(HasTeamMember && ENT_ED_LIHTC__c.recordtype.name!='Standard Deal', false, true)}" >
Note: At least one Team Member is required.<br/><br/>
</apex:outputLabel>
public boolean HasTeamMember
{
get
{
ENT_ED_LIHTC__c deal = (ENT_ED_LIHTC__c)ctrl.getRecord();
List<ENT_Enterprise_Team__c> tmForInsert = new List<ENT_Enterprise_Team__c>();
list<RecordType> rtype =[Select id,recordtype.name From recordtype where id =:deal.recordtypeid];
if(TeamMembers.size() > 0)
{
for(ENT_Enterprise_Team__c tm : TeamMembers)
{
if(tm.User__c != null && tm.Role__c != null && tm.Role__c != ''&& tm.Role__c == 'Originator' && rtype[0].name=='Standard Deal')
{
return true;
}
if(tm.User__c != null && tm.Role__c != null && tm.Role__c != '' && rtype[0].name!='Standard Deal')
{
return true;
}
}
return false;
}
else
return false;
}
}
HasTeamMember
is calculated? And what do you mean withVf page is not displaying.
? You mean output label?DeveloperName
instead ofName
when querying the record types.