How to reopen and make changes to a closed contract

I have been reading the blog from ms dynamics team about opening and changing 
a closed appointment:
http://blogs.msdn.com/crm/archive/2007/03/08/how-to-reopen-a-closed-appointment-and-make-changes-to-the-file.aspx

I'm trying to do the same thing with a contract. the code I used is almost 
the same.
I changed "Appointment" with "Contract" and the state and state Reason:

state code :
' <ContractState>Active</ContractState>'+

state Reason:
' <ContractStatus>3</ContractStatus>'+

see also http://msdn2.microsoft.com/en-us/library/aa681259.aspx

when I try the buttun, I got an error: 0X80040216 "an unexpected error 
occurred"

I've tryed different state code and Status code, but nothing worked.

Is there someone who has tryed this with more luck?

copy of the whole code:
<Entity name='contract'>
<ToolBar ValidForCreate="0" ValidForUpdate="1">
<Button Title="Reopen contract" ToolTip="Reopen this contract" 
Icon="/_imgs/ico_18_debug.gif" JavaScript="
          
var contractid = crmForm.ObjectId;
          
var serverUrl = "/mscrmservices/2006";
          
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          
//alert(serverUrl+ "/crmservice.asmx");
          
xmlhttp.open("POST", serverUrl + "/crmservice.asmx", false);
          
xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8")
          
xmlhttp.setRequestHeader("SOAPAction", 
"http://schemas.microsoft.com/crm/2006/WebServices/Execute")
          
xmlhttp.send("<?xml version='1.0' 
encoding='utf-8'?>"+"\n\n"+"<soap:Envelope"+
          ' 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'+
          ' 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'+
          ' 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">'+
          ' <soap:Body>' +
   
       ' <Request xsi:type="SetStateContractRequest"'+
          ' 
xmlns="http://schemas.microsoft.com/crm/2006/WebServices"> '+
          ' 
<EntityId>' + contractid + '</EntityId>'+
          ' 
<ContractState>Active</ContractState>'+
          ' 
<ContractStatus>3</ContractStatus>'+
          ' </Request>'+
          ' 
</soap:Body>'+
          ' </soap:Envelope>')
          var result = 
xmlhttp.responseXML.xml;
          if (result.indexOf('faultcode') < 0) 
     
     {
          window.open('/CRMReports/viewer/drillopen.aspx?ID=' + 
contractid + '&OTC=4201');
          } else {
          alert(result);
       
   }
          
          " Client="Web, Outlook" />
			  </ToolBar>
		  </Entity>
0
Utf
10/13/2007 6:57:01 AM
crm 35858 articles. 1 followers. Follow

0 Replies
474 Views

Similar Articles

[PageSpeed] 49

Reply:

Similar Artilces:

How do I change the color of some bars in an Excel bar graph?
I have a big data series and want to manually assign three different colors to the bars. Can this be done? Click once to select the entire series, then click again to select one point (one column). Then go to Format menu > Point, and apply a format to the selected point only. To do it automatically, you could set up a conditional chart: http://peltiertech.com/Excel/Charts/ConditionalChart1.html - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "fergusonlaura" <fergusonlaura@di...

Tracking changes to a form
I have a table and module set up to track all changes made to a record on my form. I am using the following code for the module: Option Compare Database Function LogChanges(lngID As Long, Optional strField As String = "") Dim dbs As DAO.Database Dim rst As DAO.Recordset Dim varOld As Variant Dim varNew As Variant Dim strFormName As String Dim strControlName As String varOld = Screen.ActiveControl.OldValue varNew = Screen.ActiveControl.Value strFormName = Screen.ActiveForm.Name strControlName = Screen.ActiveControl.Name ...

Making the Main Address populate into More addresses
Hi All, I posted this on the CRM Developer forum but have not received an answer, so I am hoping you can help. We want the main address entered on the Account General tab to populate into the More Addresses entity when we go to add more addresses for an account. I know this needs to be done via a workflow (or I am assuming) but my problem is I can't seem to see the More Addresses ( or Address entity) when I am in workflows starting with Account. Does anyone know of a way to make this happen. We still want the option of being able to change the addresses if they need to be diffe...

windows live messenger closes w/ dep on desktop but not laptop
I have completely uninstalled and reinstalled windows live messenger, and without fail it crashes with Window s vista home premium every time on my desktop computer. and yet it works fine on my laptop. The only difference is that my laptop is newer. I simply CANNOT figure out why vista is barfing on messenger. It has NEVER worked on my desktop and I'd really like to be able to chat with my friends. i even tried to add the windows live messenger to the list of "safe" programs under the DEP folder thingie,but it says that I HAVE to run msn messenger with the DEP...

Making a primitive Excel application
Hello, I'm trying to make a primitive Excel application. It is almost done but i need some help. This application would be in my shoe store. At the end of each day one sheet(or maybe two, or three) should be E-mailed to me at home and I would put it in my excel app. Now my question is this: can this process be automated. This is what I would like to do: make a button in that Excel app and when it's pushed to send just one sheet by email. that would be the first step. Any suggestions? I know VB pretty ok. Could I maybe make this process something like this: could i connect my computer ...

Change Pivot Table Page Value
I have looked through the other posts on the subject and the combination of my low skills in VB and the other solutions not exactly covering my situation means I still need to ask for help. Scenario: Worksheet a = "Scorecard" FieldName = "CustomerNumber" Worksheet b = "Products Resume" PivotTable = "PivotTable2" PivotTable Page Field = "Account Number" When CustomerNumber value on worksheet "Scorecard" is changed I need the Pivot Table Page field "Account Number" to use this value to filter the pivot t...

$$$$$ MAKE DOLLARS FROM YOUR HOUSE $$$$$$ Find out here
http://www.weekendeasycash.com ...

Change Outlook today page
Is there a way to show my "Companyweb" whenever I open outlook? Also How would I push this down to my users with a group policy? Outlook11 SBS 2k3 premium Thanks ...

Can I change Headers and footers in selected Reports at the same .
maybe... If you're writing about worksheets in the same workbook, you can group the sheets (click on the first tab and ctrl-click on subsequent tabs). Then File|page setup and change the headers/footers. Remember to ungroup the sheets (just rightclick on any of the grouped sheets and select ungroup sheets) or you may damage your workbook. Almost anything you do to a one sheet (of a group) is done to the rest of the sheets in that group. Tester wrote: -- Dave Peterson Thanks Dave, but no, I need to change headers and footers in over a hundred different folders on a regular bas...

can't uninstall and make a new installation on laptop client
Hi, I installed a laptop client and tried to uninstall it. In the uninstalling process the the setup started again and detects that an 'incompatible version' of Microsoft CRM Client is already installed. I tried to delete the correct registry keys but that only effects that there is no 'Microsoft CRM-Client' in the Software to uninstall anymore. Can anyone give me the right registry keys to delete, so that I can make a new installation? Thanks J�rg Try deleting the folders "Microsoft CRM" and "SQL Server" in Program Files. Then try to reinstall....

how do I make the cell expand to fit my text as I type?
I merged some cells across the width of a spreadsheet and i can't get the cell to increase it's height as more text is typed in wraps around. Only way I know, is to move your cursor to between the row number of therow you want to adjust and the next row. The cursor changes shape into an up/down arrow. Click and drag till you see all. Double clicking will also not work "pnwwoman" wrote: > I merged some cells across the width of a spreadsheet and i can't get the > cell to increase it's height as more text is typed in wraps around. If cells are merged. ...

Disable Accept/Reject Changes
Can Accept and Reject Changes be disabled for a Shared Workbook? I would want to enable it later. I just want to make sure that only certain people can except or reject changes. -- tj ...

Changing default page margins
Can't find instructions on how to change the default PAGE margins in Publications. It seems changing default TEXT BOX margins is covered, but not PAGE margins. I can see how to change page margins in the current publication, but not how to change the default. Help? You cannot change the default. You can create a template, when the Getting Started screen opens, click My Templates, click the created template. A couple of extra clicks... -- Mary Sauer http://msauer.mvps.org/ "ThereseW" <ThereseW@discussions.microsoft.com> wrote in message news:379EB1E2-3AD9-4438-B19...

use of contractions in Word e-mail editor
Whenever I type a contraction, such as it's, that's, can't, etc., the letter s or t appears several spaces to the right of the apostrophe rather than next to it. I've tried without success to locate anything in the grammar settings that could drive such an outcome. "Dale Pittock" <dpittock@enterprisecenter.net> wrote in message news:02fc01c356e0$70ff2be0$a601280a@phx.gbl > Whenever I type a contraction, such as it's, that's, > can't, etc., the letter s or t appears several spaces to > the right of the apostrophe rather than next to it. ...

change the format of a series in a chart
I am using a standard combination chart (column/line) to present some data that is based on 6 individual series from an Excel spreadsheet. The Chart Wizard has arranged the data so that three series are presented as lines and the remaining three are presented as columns. My dilemma is that one of those series presented as columns I want to be presented as a line. In total, I want two series as columns and four as lines. Can this be done? What do I need to do in order to change the data from a column to a line? Thanks in anticipation. Regards, Cliff Hi, Right click the column ...

How to change the title of a CPropertyPage?
I would like to change the title of a property page. I have tried to SetWindowText but it does not work. Is there a solution? Thank you in advance. Pierre Couderc See if the following KB article helps you http://support.microsoft.com/default.aspx?scid=kb;en-us;Q141487 -- Cheers Check Abdoul [ VC++ MVP ] ----------------------------------- "Pierre Couderc" <pierre@couderc.cc> wrote in message news:bfrau1$1mnu$1@biggoron.nerim.net... > I would like to change the title of a property page. > I have tried to SetWindowText but it does not work. > Is there ...

THE PAYPAL MONEY MAKING METHOD
As Seen On OPRAH & 20/20 - TURN $6 into $24600 Earn money using PAYPAL as seen on Oprah & 20/20 THE PAYPAL 6 DOLLAR MONEY-MAKING METHOD AS SEEN ON OPRAH EARN HUGE $$$$$$$$ all you need is: 1) An email address 2) A PayPal account 3) $6.00 THIS IS A 2008 , CURRENT EMAIL LIST, What do you have to lose being you are only sending 1 dollar to six people. I WAS SKEPTICAL AT FIRST, but over a few days hundreds starting appearing in my paypal account! It was like Christmas morning!!!! INSTRUCTIONS: STEP 1: The first thing to do is highlight and SAVE this entire post in word or notepad o...

Error message on closing Outlook #2
I am getting the following error message when closing Outlook: The instruction at "0x77f83907" referenced memory at "0x009a4d4c". The memory could not be "written". Click on OK to terminate the program I have tried the Microsft Online help but it wouldn't accept my product number so I wondered if anyone else had encountered such an error. I would like to know what it's doing! cheers ...

Going to CRM website via IE closes IE
I have set up a CRM 1.0 environment on a Windows 2003 SBS server. Whenever I go to the CRM website that I configured my browser (IE6) immediately closes. I have applied all of the latest updates to IE and Windows Update shows no more updates. Has anybody else had this problem? MS CRM 1.0 is not supported by any of the 2003 family. To be honest, I'm surprised that you got as far as you did. Gill >-----Original Message----- >I have set up a CRM 1.0 environment on a Windows 2003 SBS server. Whenever I >go to the CRM website that I configured my browser (IE6) immediately clos...

How do I change Hyperlinks in Visio 2007
I can only options to add new ones Hyperlinks are stored in the shapesheet, so that you can edit them there. al "Niel" wrote: > I can only options to add new ones ...

How to change the default position of cursor when writing an email
I often times accidentally hit enter (usually with my touchpad) while I'm typing an email or a reply to an email. Since the cursor, by default, sits on the send button I will sometimes send the email prematurely. When I'm thinking about it, I'll move my cursor off of that button before I start typing, but other times I forget to do that and end up sending a message before it's done. Control Panel>Mouse>Pointer Options>Untic Snap To Hope this helps! >WT< "Theo Logos" <Theo Logos@discussions.microsoft.com> wrote in message new...

GP10 Year End Close
We had a customer start a year end close for last financial year and then change their mind. They then terminated GP via Windows Task Manager killing the process. We are unable to make the customer restore back as they did this over two weeks ago and have only just told us about it and have been using GP as normal since the aborted year-end close. I have been unable to find anything on the Knowledge Base on what can be done to rectify the problems this will have created and wondered if anyone had been in this position? Ian, Well.You cannot have a KB Article on situations like this wh...

Auto Close Appoinments in 3.0
I see a couple posts regarding this in 1.2 but I am seeing in 3.0 where my appointments never auto-complete and therefore always stay under activities, not history. Anyone have any clues about this? Is there a job I should check? I couldn't find one like the 1.2 job that ran automatically to close the appointments. -- Thanks, Brian ...

Closing to divisional account segments for balance sheet
We have an account segment being used for programs that only have balance sheet accounts. Setting up GL - Close to divisional account segments requires that we have a retained earning account for each of these programs. Since some of these are used only for balance sheet purposes we do not wish to have to set up every program with a RE account just so the YE close process will run successfully . This means we have to set up many extra unsued RE accounts and feel that this should not be required. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the su...

Changing Case #3
I have a large excel document that has been typed in upper case and I wish to change it to Proper case ie. with initial capitals only. Is there an easy way to do this, please. Thanks, Robert Robert, The easiest way is probably to download the free Excel add-in "XL Extras" from http://www.realezsites.com/bus/primitivesoftware It adds menu commands on the Format menu that will change case in whatever cells you select - Proper, Upper, Lower and Sentence case. Plus it does other nice stuff. Comes with a Word.doc install/use file. -- Jim Cone San Francisco, USA "Robert ...