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)

statecode on Opportunity Reopen - Best Practice?

(0) ShareShare
ReportReport
Posted on by

CRM 2011 UR14 on premise.

I understand Microsoft gives us a Win and a Lose message on Opportunity, which is great, but there's no Reopen message. 

A few questions.

  1. I've found a few articles saying to use the SetState and SetStateDynamicEntity messages. Are those CRM 4.0? The articles seem quite old. And when I tried to fire against them, my plugins didn't trigger.
  2. What's the difference between SetState and SetStateDynamicEntity?
  3. I set statecode as a filtering attribute. This fires the plugin, but for example when going from statecode = 1 (Won) to statecode = 0 (Open), in post-operation pipeline stage, the post image contains a statecode of 1. In other words, the image doesn't reflect the change.

This is code that does certain things if the Opportunity is created, if certain fields change, or if it's Won/Lost/Reopened, so I need a reliable way to detect the status of the record after everything's done.

Sorry for the squishy question but any help is appreciated.

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at

    SetState and SetStateDynamicEntity both do the same job that is setting the status of the record.

    SetStateDynamicEntity  message is removed from crm 2011 ,but still you can see this message in plugin registration for backward compatibility. I would suggest  registering the plugin on SetState message to detect the status change of the record  rather than SetStateDynamicEntity

    You can find list of messaged that are removed from 2011 here

    https://msdn.microsoft.com/en-us/library/gg309493(v=crm.5).aspx

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