Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Weird results from a Bool value

Posted on by 25

Okay. I can work with this. But I'm really wanting to understand what is happening, because I've never had it happen this way before.

I created a standard two option field in Dynamics 2011.

When coding the plugin I'm getting the reverse value of what I'm expecting.

Here is the code:
            bool trigger = preImageEntity.GetAttributeValue<bool>("trigger");
When Yes is marked on the form, it comes back as False.
When No is marked on the form, it comes back as True.

I double checked the Options. Yes = 1 and No = 0.

Like I said, I can work with this, I'm just wondering why it's not returning the values I'm expecting.
I'm expecting Yes = True and No = False.

Thanks.


*This post is locked for comments

  • Iamoop Profile Picture
    Iamoop 25 on at
    RE: Weird results from a Bool value

    Thank you!

    That makes perfect sense and can't believe I missed it. Appreciate it.

  • Verified answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Weird results from a Bool value

    If I understand this correctly, you are retrieving value from PreImage. That means value stored in Database before change in UI.

    The current value from UI will be in Target entity.

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