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

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Option and Boolean type field check failed in same condition

(0) ShareShare
ReportReport
Posted on by 1,893

Dear Experts,
In my purchase order have a field have a boolean type field name is "Pre-Approved invoice". if PO is released and "Pre-Approved invoice" is checked then i want to show in print like as "Pre-Approved purchase order".

I write the condition in report but it is not accepting. Please help me to resolve it.

IF Status <> Status::Released THEN
txtHeader := txt002
ELSE
txtHeader := txt001;

IF Status <> Status::Released AND "Pre-Approved Invoice" = TRUE THEN BEGIN
txtHeader := txt003;
END;

1121.test01.png

7824.test02.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: Option and Boolean type field check failed in same condition

    make it

    IF (Status <> Status::Released) AND "Pre-Approved Invoice" THEN BEGIN

  • manish.yadav Profile Picture
    1,893 on at
    RE: Option and Boolean type field check failed in same condition

    Dear Sir,

    My requirement is if PO is released then name be "Purchase Order".

    If PO is not released then name be "Test Purchase Order".

    If PO is released and "Pre-Approved Invoice" field is checked in header the name be

    "Pre-Approved Purchase Order".

  • Verified answer
    Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: Option and Boolean type field check failed in same condition

    I didnt suggest you the code as per your requirement. i just suggested you the code to remove error which you are getting.

    I think you should try

    IF (Status = Status::Released) AND "Pre-Approved Invoice" THEN BEGIN

  • manish.yadav Profile Picture
    1,893 on at
    RE: Option and Boolean type field check failed in same condition

    For getting the output in my print report, I have write the code like

    IF Status <> Status::Released THEN

     txtHeader :=  txt002

    ELSE

     txtHeader :=  txt001;

    IF (Status <> Status::Released) AND ("Pre-Approved Invoice"=TRUE) THEN  

     txtHeader := txt003;

    By first block code, getting result but the below code is not giving the output. help me to resolve it. Is there any mistake in my code?

    IF (Status <> Status::Released) AND ("Pre-Approved Invoice"=TRUE) THEN  

     txtHeader := txt003;

  • Suggested answer
    ManishS Profile Picture
    86 on at
    RE: Option and Boolean type field check failed in same condition

    txtHeader := '';

    IF Status <> Status::Released THEN

      txtHeader := txt002

    ELSE

      txtHeader := txt001;

    IF (Status <> Status::Released) AND "Pre-Approved Invoice" THEN

      txtHeader := txt003;

  • manish.yadav Profile Picture
    1,893 on at
    RE: Option and Boolean type field check failed in same condition

    Not working,

    always working the first block code and getting correct result.

    if released the "Purchase Order"

    if not released then "Test Purchase Order"

    The below code is not giving result printing the "Purchase Order" not printing the

    "Pre-Approved Purchase Order"

    IF (Status <> Status::Released) AND "Pre-Approved Invoice" THEN

     txtHeader := txt003;

  • Verified answer
    Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: Option and Boolean type field check failed in same condition

    read my above comment and try

    IF (Status = Status::Released) AND "Pre-Approved Invoice" THEN BEGIN

  • ManishS Profile Picture
    86 on at
    RE: Option and Boolean type field check failed in same condition

    Did you tried what mohana has suggested.

  • manish.yadav Profile Picture
    1,893 on at
    RE: Option and Boolean type field check failed in same condition

    I am not getting his clue. Please give me brief.

  • Verified answer
    Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: Option and Boolean type field check failed in same condition

    you need to try

    IF (Status = Status::Released) AND "Pre-Approved Invoice" THEN

    instead of

    IF (Status <> Status::Released) AND "Pre-Approved Invoice" THEN

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#1
Alexander Ermakov Profile Picture

Alexander Ermakov 2

#3
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans