You need to sign in to do that
Don't have an account?
Error: Syntax error. Missing ')'
I am getting this error when using the following code:
<td><apex:outputField value="{!IF(contains(uses.Name,"Signage"),"N/A",uses.Gross_SF__c)}" /></td>
Basically, I have an object (property uses) that I repeat through to build a table of data based on the different uses of a property. If the current property use in my table is "Signage", I want to display "N/A" else I want to display the Integer value.
There is a related post http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=1071 that suggests this is a bug and a bug fix has been requested.
I am hoping that either I am doing something incorrectly and someone can point it out to me, or that someone might be able to come up with a better solution to this issue.
So the error message is bad, but it doesn't seem to like the fact that you are potentially replacing the value of outputField with a literal string. outputField doesn't work with literal strings, only sobject fields.
I think if you use outputText it will work.
If you must have the functionality of outputField, I would use outputText displaying N/A and outputField displaying the field value, and conditionally render them.
All Answers
So the error message is bad, but it doesn't seem to like the fact that you are potentially replacing the value of outputField with a literal string. outputField doesn't work with literal strings, only sobject fields.
I think if you use outputText it will work.
If you must have the functionality of outputField, I would use outputText displaying N/A and outputField displaying the field value, and conditionally render them.
That was it! Using outputText did the trick.
Thanks for the help!
So unfortunately, while the switch to outputText worked, I do need the functionality provided by outptuField (my users complain about the lack of commas in large numbers). I tried to use the apex tags as output from the IF statement, but I receive the error: Error: Syntax error. Found '<'. Wrapping the apex tags in quotes won't work because the code just gets displayed. Just thought I'd mention that if anyone else was running into this issue.
On a side, I tried using the IF statement in an outputField that had sObjects as both possible outputs and I was given the same error mentioned in the subject line of this thread.
You could do something like this, what Jill recommended above.
<td>
<apex:outputText value="N/A" rendered="{!CONTAINS(uses.Name,"Signage")}"/>
<apex:outputField value="{!uses.Gross_SF__c}" rendered="{!NOT(CONTAINS(uses.Name,"Signage"))}"/>
</td>
- Jason
Aha! Going back and reading Jill's post I think that's what she meant but i read it a different way.
Thanks for the help!
I have a formula and seems bizzare as it is working in other places but not for mailing address. I get the following Error:
Error: Syntax error. Missing ')'
Formula:
IF(
Disable_Sharing_Main_Contact_Address__c = TRUE, NULL,
(
"Mailing Street: " (MailingAddress)
)
)