Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Option and Boolean type field check failed in same condition

Posted on by 1,835

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

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

    It was a little bit confusion. Now I have applied your suggestion. And working fine.

    And I am getting the actual result.

    Thank you for your best support.

    Please close this thread.

    It is resolved.

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,135 Super User 2024 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

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

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

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

    Did you tried what mohana has suggested.

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,135 Super User 2024 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

  • manish.yadav Profile Picture
    manish.yadav 1,835 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;

  • Suggested answer
    ManishS Profile Picture
    ManishS 6,578 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
    manish.yadav 1,835 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;

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,135 Super User 2024 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
    manish.yadav 1,835 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".

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans