Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Set the State and StatusCode with ExecuteMultipleRequests

Posted on by 689

Hi Folks.

Please your help.

We are migrating from OnPremise to Online.

How to set the ‘State and Status’ using the ExecuteMultipleRequests? a. Example: If we load ‘Accounts’ with state = Inactive. i. The Accounts show ‘Active’, even though in the code, we have set the ‘inactive’.

Thanks and best regards.

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Set the State and StatusCode with ExecuteMultipleRequests

    Hi Roxana,

    According to your description, it should be failed to update the options "State and Status". Please check the following points.

    1.You need to use the field name of "State and Status" not display name.

    pastedimage1569291458128v1.png

    2.You can't set value to optionset field like other text fields in C#, you need to use other classes like "optionSetValue".

    https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg327696(v=crm.8)?redirectedfrom=MSDN

    https://crm365blog.wordpress.com/2018/05/29/get-set-field-values-in-c-javascript-and-utility-functions/

    For example: 

    entity["BusinessType"]=new optionSetValue(0);  ///type1=0, type2=1

    Hope it helps.

    Bset Regards,

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans