I need to store the result of the outputfield in a visualforce variable. I have an object that has a picklist value that is translated into several languages(translation workbench). When the picklist field is output using the apex:outputfield tag, the picklist value gets translated into the language that is set in the visualforce page, something like below:
<apex:outputField value="{!Opportunity.Phase__c}" lang="es"/>
My issue is that all the picklist values on the field Phase__c have a weird prefix, for example, d.phase1, g.phase1, h.phase1. My idea is to keep the result of the apex:outputfield in a apex:variable and then using the SUBSTITUTE function to get rid of the weird prefix. I cannot use javascript because everything is done in an email template.
I tried the following but does not work:
<apex:variable var="phase" value='<apex:outputField value="{!Opportunity.Phase__c}" lang="es"/>' />
How can I accomplish this?
<apex:variable var="phase" value="{!Opportunity.Phase__c}/>
? – Mohit Arora Nov 19 '17 at 5:19