Closing a Dynamics CRM Opportunity as won or lost

734 views
Skip to first unread message

rriopel432

unread,
May 1, 2012, 5:48:30 PM5/1/12
to CozyRoc
Does anyone have a script that closes an opportunity as won or lost
that they can share? I can update the Opportunity status just fine.
However, the opportunity close activity that is created is blank. I'd
really like to be able to use the WinOpportunityRequest and
LoseOpportunityRequest instead.

Ivan Peev

unread,
May 1, 2012, 11:28:27 PM5/1/12
to coz...@googlegroups.com
Hi Ray,

You don't have to use any script. You can update the status using the Dynamics CRM Destination component.

You have to use the following values for statecode attribute (integer): 1 - Won, 2 - Lost

You can also optionally provide statuscode attribute (integer).

Regards,
Ivan

rriopel432

unread,
May 2, 2012, 7:56:28 AM5/2/12
to CozyRoc
Ivan,

I did try that and it did work in a way. The Opportunity is closed
and an Opportunity Close activity is generated. However, the values
of the Opportunity Close are not filled in - Actual Revenue, Closed
Date. They are set in the Opportunity correctly.

I would like to reproduce what happens in the user interface as much
as possible.

Ray

Ivan Peev

unread,
May 2, 2012, 10:23:37 PM5/2/12
to coz...@googlegroups.com
Hi Ray,

I see what you are saying. Can you provide a list of Opportunity Close attributes you want to set? Does they relate to Opportunity and if so what is the relationship?

If there is a direct relationship, we will implement enhancement to set Opportunity Close attributes, based on the Opportunity attributes.

rriopel432

unread,
May 3, 2012, 10:33:44 AM5/3/12
to coz...@googlegroups.com
I would be interested in having the information from the Close Opportunity form:
- Actual Revenue
- Close Date
- Competitor
- Description

The Actual Revenue and Close Date fields are stored on both the Opportunity entity and the Opportunity Close activity.  The Competitor and Description is only stored on the Opportunity Close entity.

Ivan Peev

unread,
May 3, 2012, 8:30:41 PM5/3/12
to coz...@googlegroups.com
Hi Ray,

Let me ask another question. Did you see opportunityclose entity is available in the list of entities you can select in the Dynamics CRM destination component? Did you try to update opportunityclose entity, providing the attributes you need below ?

rriopel432

unread,
May 5, 2012, 7:32:28 AM5/5/12
to coz...@googlegroups.com
I don't believe it can be updated because the activity is closed.  I can update the DB directly though.  I'll give it a try to see though.

rriopel432

unread,
May 24, 2012, 9:13:03 AM5/24/12
to coz...@googlegroups.com
Ivan,

I created a script to do close an opportunity and another one to properly close a Case.  I will post them to the Script library on the CozyRoc site.  This were done using the 1.6 Beta release though.  Will there be any issues posting the scripts at this time?

Ray

Ivan Peev

unread,
May 24, 2012, 2:28:11 PM5/24/12
to coz...@googlegroups.com
Hi Ray,

We had to disable the public posting at the script repository because of spammers. Feel free to send the script to me and I will published it. Thank you!

Regards,
Ivan
Reply all
Reply to author
Forward
0 new messages