Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Select lookup fields and optionset field in Selenium Automation for CRM

Posted on by 230

Dear Communities,

we can able to update single line of text field in section tab in Selenium in C# but same tab we have lookup and optionset fields but cannot able to submit it. How we can select search option in lookup field then how to select first record in lookup field?

Thanks & Regards,

Dan

*This post is locked for comments

  • Suggested answer
    Sreevalli Profile Picture
    Sreevalli 3,256 on at
    RE: Select lookup fields and optionset field in Selenium Automation for CRM

    Hi,

    For Lookups you have to retrieve records with the string text then it will give EntityCollection, from that pick the 1st item something like collection[0]. follow below supporting link

    https://community.dynamics.com/crm/b/magnetismsolutionscrmblog/archive/2016/04/12/queryexpression-filter-lookup-by-name-instead-of-id-crm-2016 

     

    For optionsets, In CRM it is keyvalue pair, for each string value there will be corresponding value option which you should use in code.

     

    Example:

    1 : Male

    2 : Female

    Syntax --> my_optionSet = new OptionSetValue(Male)

     

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans