0

I am working on a custom Visualforce page where I have requirement for a button to function based on a criteria.

This working good:

<apex:customButton onclick="{!IF(OR(c.first, c.second), 'doSomething();', 'process();' )}"/>

But this is not and is this even valid:

<apex:customButton onclick="{!IF(OR(c.first, c.second), 'IF(c.first, 'doSomething1();', 'doSomething2();')', 'process();' )}"/> 
  • 2
    You don't need quotation marks around the nested IF() function. – David Reed Mar 30 '18 at 16:04
  • 1
    Oh yes, that works now. I thought that was an exception for the onClick. I feel the difference now. – Austin Evans Mar 30 '18 at 16:07
  • @DavidReed You could post your comment as an Ans, I would love to mark it. Thanks – Austin Evans Apr 2 '18 at 15:38
0

You don't need quotation marks around the nested IF() function. Simply removing them should allow the nested IF()s to evaluate cleanly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.