web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Boolean error in D365FnO

(0) ShareShare
ReportReport
Posted on by 1,215

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"

pntamt.PNG 

Thanks 

I have the same question (0)
  • WillWU Profile Picture
    22,361 on at

    Hi Riyas,

    What's the return of your CalculateEOSAccrual() method? You should a boolean value in the if statements.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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).

  • Riyas ahamed F Profile Picture
    1,215 on at

    Thanks for replay Mr.Will,

    That CalculateEOSAccrual()  method no return anything its 'Void' used in it.

  • Riyas ahamed F Profile Picture
    1,215 on at

    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.

  • Verified answer
    WillWU Profile Picture
    22,361 on at

    Hi Riyas,

    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.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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)

  • Verified answer
    Khurshid Wali Profile Picture
    928 on at

    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

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans