Notifications
Announcements
No record found.
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,
What's the return of your CalculateEOSAccrual() method? You should a boolean value in the if statements.
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).
Thanks for replay Mr.Will,
That CalculateEOSAccrual() method no return anything its 'Void' used in it.
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.
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.
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)
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
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…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader