You need to sign in to do that
Don't have an account?
Edwin Herrera
If Else Conditional Statement
I have to input text area fields. I want to display one of these fields based on the value of the third field. The following is the code I have tried to give the result I want. This code is giving me the follwing error (missing '='). I would like any help I can get. thank you.
{!if ([Work_Item__c.Percent_Complete__c==100]){
<apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Final_Status_Summary__c}"/>
}else {
<apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Status_Summary__c}"/> }}
{!if ([Work_Item__c.Percent_Complete__c==100]){
<apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Final_Status_Summary__c}"/>
}else {
<apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Status_Summary__c}"/> }}
All Answers
Error: Syntax error. Missing ')'
I this does not work, would you have an idea of how else I could get the result I want?
<div id="status">
<div id="sh"><p id="sht">Status Summary</p></div>
<div id="health">
<p id="h3t">Scope/Quality Health<apex:inputField style="margin-bottom:1em" value="{!Work_Item__c.Quality_Scope_Health__c}"/> 
Schedule Health<apex:inputField style="margin-bottom:1em" value="{!Work_Item__c.Schedule_Health__c}"/> 
Risk Health<apex:inputField style="margin-bottom:1em" value="{!Work_Item__c.Risk_Health__c}"/></p>
</div>
<div id="srich">
<apex:inputTextarea richText="true" cols="100" rows="15" value="{!IF(Work_Item__c.Percent_Complete__c==100, Work_Item__c.Final_Status_Summary__c, Work_Item__c.Status_Summary__c)}"/>
</div>
</div>
Do mark my answer as best answer if it helped solve your problem
Error: WIP_STaRT line 86, column 115: Element type "apex:inputTextarea" must be followed by either attribute specifications, ">" or "/>"
Error: Element type "apex:inputTextarea" must be followed by either attribute specifications, ">" or "/>".
<apex:page standardController="Work_Item__c" showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false" docType="html-5.0">
<html>
<style type="text/css">
* { font-family:"Times New Roman", Times, serif; margin:0; }
div{margin:0;padding:0;margin:auto;}
#container{height:55.2em;width:101em;border:1px solid black;position:relative;}
#Header{height:6em;width:100.7em;border:2px solid black;}
#header1{height:6em;width:25em;float:left;border-top:1px solid black;border-left:1px solid black;border-bottom:1px solid black;text-align:center;}
#header2{height:6em;width:40em;float:right;margin-auto;border:1px solid black;text-align:center;}
#header3{height:6em;width:35em;float:right;border-top:1px solid black;border-right:1px solid black;border-bottom:1px solid black;text-align:center;}
#h1t{margin-top:.1em;font-size:1.25em;}
#h2t{font-size: 3em;margin-top:1em;}
#h3t{margin-top:1em;font-size:1.15em;}
#pc{height:3em;width:13.2em;position:absolute;top:14.5em;left:0;;font-size:1.5em;}
#executive{height:21em;width:50.4em;border:1px solid black;position:absolute;top:6.2em;left:0;}
#status{height:22em;width:50.4em;border:1px solid black;position:absolute;top:9.2em;right:0;}
#health{height:3em;width:50.4em;border-bottom:1px solid black;position:absolute;top:6.2em;right:0;text-align:center;}
#value{height:21em;width:50.4em;border:1px solid black;position:absolute;top:27.2em;left:0;}
#risks{height:21em;width:50.4em;border:1px solid black;position:absolute;top:31.2em;right:0;}
#costs{height:7em;width:50.4em;border:1px solid black;position:absolute;top:48.2em;left:0;}
#sh{height:2em;width:20em;border:1px solid black;position:absolute;top:0;left:0;}
#sht{font-size:1.6em;margin-top:0.2em;}
#business{height:5em;width:50.4em;position:absolute;top:1em;text-align:center;margin-top:1em;border-top:1px solid black;}
#rich{height:18.6em;width:50.2em;position:absolute;top:2.1em;border:1px solid black;}
#srich{height:19.6em;width:50.2em;position:absolute;top:2.1em;border:1px solid black;}
#buttons{height:3em;width:12em;position:absolute;top:14.5em;right:0;;font-size:1.5em;text-align:center;}
</style>
<apex:form >
<div id="container">
<div id="Header">
<div id="header1">
<apex:pageBlock >
<p id="h1t">Work Item ID  : <apex:outputField value="{!Work_Item__c.Work_Item_ID__c}"/><br/>
Work Item Name: <br/><apex:outputField label="Work Item Name" value="{!Work_Item__c.Name}"/></p>
</apex:pageBlock>
</div>
<div id="header3">
<p id="h3t">Forcasted Finish<apex:inputField value="{!Work_Item__c.Forecasted_Finish__c}"/> 
Overall Health<apex:inputField value="{!Work_Item__c.Overall_Health__c}"/> <br/> </p>
<p id="h3t">Status as of<apex:inputField value="{!Work_Item__c.Status_as_of__c}"/> 
LSEF Stage<apex:inputField value="{!Work_Item__c.LSEF_Stage_del__c}"/>
</p>
</div>
<div id="header2">
<p id="h2t">Executive Summary</p>
</div>
</div>
<div id="executive">
<div id="sh"><p id="sht">Executive Summary</p></div>
<div id="rich"><apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Executive_Summary__c}" /></div>
</div>
<div id="value">
<div id="sh"><p id="sht">Value/Business Outcomes</p></div>
<div id="rich"><apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Value_Measurement__c}"/> </div>
</div>
<div id="costs">
<div id="sh"><p id="sht">Ownership and Costs</p></div>
<div id="business">
<p id="h1t" style="margin-top:1em;">Accountable IT Leader :<apex:inputField value="{!Work_Item__c.Accountable_IT_Leader__c}"/>  
Work Sponsor :<apex:inputField value="{!Work_Item__c.Work_Sponsor__c}"/> </p>
<p id="h1t">Total Estimated Project Cost: OpEx:<apex:inputField value="{!Work_Item__c.OpEx_Cost__c}"/> 
CapEx:<apex:inputField value="{!Work_Item__c.CapEx_Cost__c}"/></p>
</div>
</div>
<div id="risks">
<div id="sh"><p id="sht">Risks/Issues</p></div>
<div id="rich"><apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Risks_Issues__c}"/> </div>
<div id="pc">Percent Complete<apex:inputField value="{!Work_Item__c.Percent_Complete__c}"/></div>
<div id="buttons">
<apex:commandButton action="{!save}" value="Save" style="height:2.5em;width:5em;"/> <apex:commandButton action="{!delete}"
value="Delete" style="height:2em;width:5em;" />
</div>
</div>
<div id="health">
<p id="h3t">Schedule Health<apex:inputField value="{!Work_Item__c.Schedule_Health__c}"/> 
Risk Health<apex:inputField value="{!Work_Item__c.Risk_Health__c}"/> 
Scope/QA Health<apex:inputField value="{!Work_Item__c.Quality_Scope_Health__c}"/> 
Budget Health<apex:inputField value="{!Work_Item__c.Budget_Health__c}"/></p>
</div>
<div id="status">
<div id="sh"><p id="sht">Status Summary</p></div>
<div id="srich">
<apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Final_Status_Summary__c}
rendered="{!IF(Work_Item__c.Percent_Complete__c==100, true, false)}"/>
<apex:inputTextarea richText="true" cols="100" rows="15" value="{!Work_Item__c.Status_Summary__c}"
rendered="{!IF(Work_Item__c.Percent_Complete__c==100, false, true)}"/>
</div>
</div>
</div>
</apex:form>
</html>
</apex:page>