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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to set two option value in dynamics CRM?

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

When i am set two set value,they give me the error"Can not insert duplicate value".

And Code is:

selectedEntity["new_llc_identifybuyerorseller"] = getRate.GetAttributeValue<bool>("new_llc_buyerorseller");

How to solve this?

Please give me suggestion.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shidin Haridas Profile Picture
    3,499 on at

    Please debug and see if this is working:

    getRate.GetAttributeValue<bool>("new_llc_buyerorseller");

    Your code snippet to read the value of a 2-option attribute is right.

    so, the issue must be elsewhere, possibly if you are tyring to add the same key to the object again.

  • Suggested answer
    Justinjose Profile Picture
    2,707 on at

    Hi Yatish,

    Can you try following options.

    1. To test add hard coded value like this selectedEntity["new_llc_identifybuyerorseller"] = true;

    2. comment the line to check issue is not causing from elsewhere.

    Thanks

    Justin Jose

  • Community Member Profile Picture
    on at

    Hi

    Is it possible to get some more code?

    Shidin Haridas is talking about adding the same key to an entity twice could throw this error. I actually purposely tried this in a console application and the error you get for doing this is: System.ArgumentException: 'An item with the same key has already been added.'

    This is not the same error as you get. To identify what is causing you trouble, you may need to add more code.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Liquid error: parsing "/globalsearch/?q=2317+*+4159" - Nested quantifier *.