You need to sign in to do that
Don't have an account?
Brian Sherman 22
Conditional text translation in VisualForce Component
We have the following VF component that lists out unit availability for our company. It returns results and switches out English text for French text in our autoresponse:
<apex:repeat value="{!lstRentals}" var="item">
<tr>
<td style="text-align:left;padding:5px;"> {!CASE(item.strSiteType,"Bachelor","1 1/2","Junior 1 Bedroom","2 1/2","1 Bedroom","3 1/2","2 Bedroom","4 1/2","3 Bedroom","5 1/2","4 Bedroom","6 1/2","Parking","stationnement","unknown")}</td> <td style="text-align:left;padding:5px;"> {!item.strRent} </td>
<td style="text-align:left;padding:5px;"> {!if(item.strAvailableDate='immediate','immédiatement',item.strAvailableDate)}</td>
</tr>
</apex:repeat>
This is working great, but I need to do the same in a slightly different component. Currently that component does not translate, and looks like this:
<td style="text-align:left;padding:5px;"> {!n.result['Suite_Type__c']} </td>
I tried the version below without success, not surprisingly as I am a novice at this.
{!CASE(!n.result['Suite_Type__c'],"Bachelor","1 1/2","Junior 1 Bedroom","2 1/2","1 Bedroom","3 1/2","2 Bedroom","4 1/2","3 Bedroom","5 1/2","4 Bedroom","6 1/2","Parking","stationnement","unknown")}
Any ideas on how to map the {!n.result['Suite_Type__c']} so the text is modified as above?
<apex:repeat value="{!lstRentals}" var="item">
<tr>
<td style="text-align:left;padding:5px;"> {!CASE(item.strSiteType,"Bachelor","1 1/2","Junior 1 Bedroom","2 1/2","1 Bedroom","3 1/2","2 Bedroom","4 1/2","3 Bedroom","5 1/2","4 Bedroom","6 1/2","Parking","stationnement","unknown")}</td> <td style="text-align:left;padding:5px;"> {!item.strRent} </td>
<td style="text-align:left;padding:5px;"> {!if(item.strAvailableDate='immediate','immédiatement',item.strAvailableDate)}</td>
</tr>
</apex:repeat>
This is working great, but I need to do the same in a slightly different component. Currently that component does not translate, and looks like this:
<td style="text-align:left;padding:5px;"> {!n.result['Suite_Type__c']} </td>
I tried the version below without success, not surprisingly as I am a novice at this.
{!CASE(!n.result['Suite_Type__c'],"Bachelor","1 1/2","Junior 1 Bedroom","2 1/2","1 Bedroom","3 1/2","2 Bedroom","4 1/2","3 Bedroom","5 1/2","4 Bedroom","6 1/2","Parking","stationnement","unknown")}
Any ideas on how to map the {!n.result['Suite_Type__c']} so the text is modified as above?
{!CASE(!n.result['Suite_Type__c']
All Answers
are you receiving any error messages? whats your n variable?
When I try to trigger the email template that callse this component, I get an error:
Error occurred trying to load the template for sending preview email: Incorrect parameter type for function 'NOT()'. Expected Boolean, received Text. Please try editing your markup to correct the problem.
My n variable:
<apex:repeat value="{!site}" var="n">
{!CASE(!n.result['Suite_Type__c']