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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to set a Quote in Active State with CWA

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

I wrote a CWA to help bulk edit records, regardless their state.

Everything works fine exept for active quotes. If a quote is active and in progress, I put it in draft state, do the update and try to reactivate it via C# code:

SetStateRequest state = new SetStateRequest
                    {
                        State = new OptionSetValue(attribStateCode),     //1
                        Status = new OptionSetValue(attribStatusCode),   //1
                        EntityMoniker = entRef
                    };
                    service.Execute(state);


The error message I get is quite confusing:

1 is not a valid status code for state code QuoteState.Active

Because statuscode 1 == In Progress.

Does anyone know what I am doing wrong?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Well...nevermind... I just realized, that the option set value of "In Progress" for Status "Active" is not '1' but '2'...

    That does not realy make sense to me because my code reads the actual OptionSetValue and it reads '1'.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans