function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JimmyMacJimmyMac 

SubTotal Page Break Logic...

Hi all,

 

I am trying to compare two apex:variables (Current Prod Type and the previous prod type) and if they are different do a Subtotal line in a table:

 

 <apex:outputText value="{!if(!myProdTyp == !LastProdTyp,'','<tr><td>SUBTOTAL</td></tr>')} ">
  </apex:outputText>

 

Both LastProdTyp and myProdTyp are apex:variables.

 

I am getting an error message when I try the above syntax saying: Error: Incorrect parameter type for function 'not()'. Expected Boolean, received Text

 

Please advise. Thanks in advance!

-Jim

Best Answer chosen by Admin (Salesforce Developers) 
Shailesh DeshpandeShailesh Deshpande
You dont need to use the exclamation mark for referencing every property. You can simply use:

{!If(myprodtype == lastprodtyp, ' ' , '<tr><td>subtotal</td></tr>')}

But the error is w.r.t NOT function. I dont see you using not anywhere. Can you post entire code?

All Answers

Shailesh DeshpandeShailesh Deshpande
You dont need to use the exclamation mark for referencing every property. You can simply use:

{!If(myprodtype == lastprodtyp, ' ' , '<tr><td>subtotal</td></tr>')}

But the error is w.r.t NOT function. I dont see you using not anywhere. Can you post entire code?
This was selected as the best answer
JimmyMacJimmyMac

Thanks the "Not" part of the error I believe was because of the '!'... It was thinking I wanted to do a "Not". Once I removed the "!" the error message was fixed.