Notifications
Announcements
Hi all,
i wrote an one display method and that display am getting one error how to resolve that issue ?
Error says : "Expression 'calculation.CalculateEOSAccrual()' must resolve to a Boolean"
Thanks
Hi Riyas,
As we know "IF" is a conditional statement in programming language and it needs boolean values "True" or "1" or any integer value not equal to 0 to perform an action or not perform Action in case of "False" or '0'.
I think your calculation.CalculateEOSAccrual() is not returning anything Void or returning some string.
to make it work kindly change your method to return any value.
if it not boolean. try some thing like this if(calculation.CalculatedEOSAccrual()=="Return Value") .
Note: "Return Value" is just an example
You can of course call the method. But you can't have a condition that is based on the return value of a method that doesn't return anything! I'm sure it's clear to you, too.
If it's not clear, please let us know what is the purpose of your if statement. What should it do? And in what situations should the code execution go inside the if statement and when should it not?
Please check this article, it will help you understand about conditional statements: en.wikipedia.org/.../Conditional_(computer_programming)
That's the problem, you could try to change the method and give it a boolean return.
But it's all based on your requirement.
Thanks for you replay sir,
you're correct, its return type is void so how to ignore that issue ? i want to use that method.
Thanks for replay Mr.Will,
That CalculateEOSAccrual() method no return anything its 'Void' used in it.
Any condition in an if statement must be possible to resolve as boolean (true or false).
You need to go to calculation.CalculateEOSAccrual() and see what's the return type. Perhaps it doesn't return anything (return type is void).
What's the return of your CalculateEOSAccrual() method? You should a boolean value in the if statements.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 580 Super User 2025 Season 2
Abhilash Warrier 428 Super User 2025 Season 2
Martin Dráb 329 Most Valuable Professional