Trouble with Closing a Quote through SDK

 I have succesfully changed the the quote to active, now I need to add 
functionality to close it. I have attempted to do this 2 different ways. Both 
methods return the generic "Unexpected Error" message. It kind of makes sense 
that the second one might fail since the object does not exist in the 
quoteclose entity, however, I was hoping that CRM might be smart enough to 
create it.

method 1:
Public Function SetQuoteclose(ByVal qte As quote) As Boolean
        Dim closequote As New CloseQuoteRequest
        Dim success As Boolean

        Dim crmserv As New CrmService()

        Try
            crmserv.Credentials = 
System.Net.CredentialCache.DefaultCredentials
            crmserv.PreAuthenticate = True

            closequote.QuoteClose = qte
            closequote.Status = -1

            Dim stateset4 As CloseQuoteResponse = 
CType(crmserv.Execute(closequote), CloseQuoteResponse)

        Catch e As System.Web.Services.Protocols.SoapException
            errormsg = e.Detail.InnerText
            success = False
        End Try

        Return success
    End Function

Method 2:

Public Function SetQuoteclose(ByVal qte As quote) As Boolean
        Dim closestate As New SetStateQuoteCloseRequest
        Dim success As Boolean

        Dim crmserv As New CrmService()

        Try
            crmserv.Credentials = 
System.Net.CredentialCache.DefaultCredentials
            crmserv.PreAuthenticate = True

            closestate.QuoteCloseState = QuoteCloseState.Canceled
            closestate.QuoteCloseStatus = -1
            closestate.EntityId = qte.quoteid.Value

            Dim stateSet3 As SetStateQuoteCloseResponse = 
CType(crmserv.Execute(closestate), SetStateQuoteCloseResponse)

        Catch e As System.Web.Services.Protocols.SoapException
            errormsg = e.Detail.InnerText
            success = False
        End Try

        Return success
    End Function

Thanks
0
Utf
12/22/2006 5:08:00 AM
crm 35858 articles. 1 followers. Follow

0 Replies
849 Views

Similar Articles

[PageSpeed] 38

Reply:

Similar Artilces:

Internet Explorer closes the CRM Window when exporting to Excel
We have a problem whenever a user exports data to Excel. The calling IE window closes when this is done. We use IE 6 and CRM 3.0 in this implementation. If we start CRM in "non-app" mode, the problem disappears. But of course we don´t want the users to have two rows of menus etc. Any suggestions? Hi Per, Have you installed rollup 1 or 2? Maybe that solves the problem. I have heard of the problem before but don't know what the solution was. I will have a look... Regards, Bas "Per Holgersson" wrote: > We have a problem whenever a user exports data to ...

Application crashes when closed
Hi, I have a windows application written using MFC , VC++ 6.0, I am using the Application Verifier debugging tool to solve some bugs in my application. When running in debug mode with the Application Verifier running in the background, the application crashes when I close it. I have overriden the OnClose method to do the following : void CRecorder6Dlg::OnClose() { char HeaderID[MAX_UID_LEN +10]; char TxIP[20]; //change CFileFind finder; SHORT TimeOut = 0; SYSTEMTIME Timey ; //System time structure PSYSTEMTIME Ptr2; Ptr2 = &Timey; char cDate[11]; char cTime[9] ; Get...

Trouble with the template.
I want to reset the 'normal' template to default to "Times New Roman" 10point font, and the pages numbered centre top. This seems to work when I set and reopen Word2003 from the Administrator Template vis: C:\Documents and Settings\Administrator\Application Data\Microsoft\Templates. But it will not work when I open Word2003 normally from the desktop. I have deleted the "Normal.dot" from the following and copied in the "Normal.dot" from the Administrator above: C:\Documents and Settings\All Users\Application Data\Microsoft\Templates...

Customise Opportunity Close Screen
Is it possible to customise the opportunity close screen? I am looking to add a few extra items to the 'Status Reason' dropdown. Thanks in advance. To change the status reason list you need to modify the statuscode attribute not the form it self. However the opportunity close entity is a system entity and cannot be customized so there is no method to do this. You can try to update the stringmap and statusmap tables in the CRM database, but this is not a supported customization. But aslong as you only add entries it may just work. -- Patrick Verbeeten (MCPD) Lead Developer Avi...

Email trouble with New User in Active Directory
Below is a trail of posts that have been made. My problem has yet to resolved and I need some help quickly. The only other thing I can think of is to reinstall Exchange Server 2003. Hopefully someone will know the answer. Thanks! Subject: Re: Email not Setup when new user created in Active Directory From: "Bryan Hill" <bthill@comcast.net> Sent: 8/15/2004 12:30:21 PM We have other clients that are working fine. Just when we try to set up new ones - it will create the SMTP address but not the X400 address. I tried manually forcing the X400 but it will...

trouble with CrmIsapi.dll
I was experiencing the same problem with the SDK as many have posted to this group ... "the WhoAmI() call results in a http error 405 when running sample code" I followed some of the advice; checked my .srf mapping to CrmIsapi.dll and re-registered the CrmIsapi.dll. when I re-register CrmIsapi.dll I get an error 80004005 - unspecified. ??? I copied it to various places and retried it ... same result. I got the original from the disk and retried ... same result. unmapped it from .srf, restarted and retried to register it ... same result. Anyone experienced this. What's up with m...

Problem with "att-1.unk" file
I use MS Outlook 2000 SR1 (9.0.0.3821). When receiving e-mail with attached file (extention doesn't matter) from one of my partners I always see this file as "att-1.unk" file. He uses MS Outlook too. This "att-1.unk" may be "stripped" of additional header using programs designed for "winmail.dat" files (for instance tnef.exe). I verified, that my partner used "Plain text", not "Rich text formant" when sending his e-mails. I received the same "att-1.unk" file when I tried to use Outlook Express instead of MS Outlook. Its...

"Microsoft CRM Applications Professional v. 1.2" -- Guidence
Hi, I have planned to take MSCRM1.2 exams, Any one who has finished "Microsoft CRM Applications Professional v. 1.2", pls tell me the following details. what is the question pattern ? areas to be concentrated ? is there any programs to be written in the exam ? any model questions ? will there be any questions from installation of MSCRM ?(since it has seperate exam) what level of hands on experience is important to clear this exam ? is there any moc exams available ? Thanks in advance. Regards, You need to be totally familar with the entire application as it focuses more on funct...

Hide worksheets before close
I have a workbook with multiple sheets that I would like to Hide before close. I am using a macro attached to a "Quit" button, but it does not work. I also have a Sub in ThisWorkbook, but I can't seem to call it Sub Button14_Click_Quit() Application.DisplayAlerts = False Worksheets("A Detail").Visible = False Worksheets("A Metrics").Visible = False Worksheets("B DV Detail").Visible = False Worksheets("B DV Metrics").Visible = False Worksheets("B Detail").Visible = False Worksheets("B Metrics&qu...

Disable "Found New Hardware"
I have Win98 installed on a dual boot (with Win XP) partition which I use for running old software - mostly games. Each time I boot into Win98 I keep getting the Found New Hardware messages relating to USB devices. As I will never print, view CF card data, or back-up to an external HD, from this partition, is there any way I can disable the message/s please? None of these devices have ever been installed on Win 98 and I wonder if I would be able to find any Win 98 drivers for them, anyway. I have searched on-line for Win98-specific information, but without finding anything ...

"554 <name1-name2@bluewin.ch> Relay access denied." Email didn't.
I attempted to email a friend in Switzerland at: "name1-name2@bluewin.ch" (I actually used a hyphenated name rather than name1-name2.) This is a new computer and new email address for my friend. The email was returned as undeliverable with this notation: "554 <name1-name2@bluewin.ch> Relay access denied." What does this mean, and, more importantly, what must I do to successfully transmit email to this address? Thank you. Jim A relay is often presented by an SMTP Gateway that is trying to pass on the message to another Gateway/Mail server. What you want to ...

the close button at the preview of a MFC application
Hi, How can I catch the message of the close button at the preview of a MFC application? Thanks a lot. Jim ...

unexpected conversion trouble
I wanted to open an Excel file I hadn't been working on for a while, an Excel couldn't do it. After some investigations, I found that even if the file still had th .xls extension, it seemed to be conveted in .doc format (in fact, whe I open it in notepad, I can see at the end some words that look like MSWord signature). I don't know how this happened, but I'm reall embarassed beacause i really need the data in this file. I tried to change the extension to .doc, open the file in Word and the import in Excel, but I can hardly see part of the file. What's more, i is a 3-she...

Trouble with Outlook 2003 and PST File
Hi, We have a user who is using Outlook 2003 and moves most emails to a PST file which is considered archived email data. They have reached the Max limited on this PST file of 1.99GBs and its not letting them open the PST file. It is trying to repair it when they try to open the PST file. Here is the message they receive: "Can't move the items. The file <path>\<filename>.pst has reached its maximum size. To reduce the amount of data in this file, select some items that you no longer need, and then permanently delete them." I can't even get it open to delete...

Trouble with Pivot Tables & Named Ranges
Can I use a dynamic named range setup in one file as a range in pivot tables in another file? When I have the data source file (with the named range) and the pivot report files open, the pivot reports update just fine. But the moment I close the source data, the pivot reports no longer can update and I get a message that the source can't be found. If I reopen the source, the pivot tables work fine again - but as soon as I close it up, the reports no longer work. The source file is very large and I don't want to open it every time I have to update all the reports tha...

I am in trouble
Hi, I am a student in Cambodia.I don't have any girlfriend. I tried everything. I looked at them wrote poem to them it doesnt work. I got an account from facebook, hi5 friendster myspace. I have 0 girl friend. What should I do? I am so desperate. I am good looking and 250 kg only. Please help me or at least send me some foood I am hungry Best Regards Hungry Guy __________ Information from ESET NOD32 Antivirus, version of virus signature database 4944 (20100314) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com You're tr...

Trouble with "time" in formulas
I have a time sheet that looks something like this: A1=time...A2=time...A3=A2-A1+if(A1/24,1)...A4=if(or(A3<time(0,15,0),A3>time(4,0,0)),A3,time(4,0,0)) A1 and A2 are set up as dropdown lists and the times in the list are i increments of 15 minutes. WHat I'm trying to accomplish is (in cell A4 if A3 is between 15 minutes and 4 hours, then return 4 hours. if A3 i 0 or greater than 4 hours, return A3. If I enter enter times in A1 around 00:00 and A2 a little after 00:0 it works fine... example: A1=22:00...A2=01:00...A3=03:00...A4=04:00 A1=20:30...A2=00:15...A3=03:45...A4=04:00 A1=00...

printerror:"unable to load client print control" 4.0 report
I am using CRM 4.0 with SQL Server 2008, is there a fix for this? I did remove the KB956391 update on the client but that only allowed me to try to install the print control. When I try to install the control it looks like it finishes and then I get the same "Unable to load client print control". I am using Windows XP Prof. The server is Server 2003. RisingSunND, I'm going to give credit to my colleague, Dave Ireland, on this answer. --- • install the SRS redistributable package on the CRM server • install SQL SP3 on the SQL database and the SSRS server (if they are diff...

trouble
I have been using my MS Publisher 2000 for over 3 years. Just recently I attempted to access the Publisher program and got the following message: "This application must be installed to run. Please run setup fom the location where you originally installed the application." I have done everything I know to fix this including uninstalling and reinstalling the program. I don't understand what happened overnight nor do I understand the instruction "run from the location you originally installed the program". I can not access the numerous publicaions that I have cr...

Full "Loop" jSON Example?
I am trying to do something which would seem so simple: I have a simple Class in ASP.NET that I want to set up to be called and consumed by a jQuery $.getjson() in a client-side JavaScript. The Class I want to serialize to json as very simple (except that it has two fields that are DateTime's and I've heard they're complicated). I'd love a sample (if anyone has one) of the full code of the ASPX that serializes and then delivers json (properly ContentType'd), AND a sample HTML with the jQuery that $getjson()'s it and uses it. I am having such a hard t...

"save as" instead of "open" message
Hello, when I try to open a message in Outlook 2007 with a double click I get sometimes the "save as" dialog box. It is not possible to close the box or to save the message and it closed itself. I have to kill the outlook process. Auto repair doesn't correct the problem. Trying another computer has the same problem. I think it must be a profile problem? After some minutes the message open. Does anyone has a hint for me? Thank you. Michael ...

Trouble sorting a table???
Using Excel 2002) I am relatively new to Excel and can only really perform simple functions in a basic spreadsheet. The spreadsheet I'm having trouble with is pretty basic, but I'm having trouble sorting some of the results from a table. (I'll try and explain as best as I can) I have 10 people that I'm tracking 5 different things for (dates, debts, credits, items, number of transactions, and their balance as calculated in this table by simple SUM functions) I then have another table with these same 10 people with their total balance. This is the table I'm having t...

why I can not close DialogBox?
I tried my best to close the DialogBox,but failed. The whole code is below. #include <windows.h> #include"resource.h" INT_PTR CALLBACK DlgProc1(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) { MSG msg; DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL,(DLGPROC)DlgProc1); while (GetMessage (&msg, NULL, 0,0)) { TranslateMessage(&msg); DispatchMessage(&m...

Exchange 2003 "Send as" Rights Problem
On exchange 2003 servers, the local administrators group has "send as" rights on the server. Since Domain admins group is in the local administrators group this creates a Security issues. I know this affected Exchange 2000 and was addressed with a hot fix. Has anyone seen this in Exchange 2003 and / or have a work around. Thanks. We are having a similar problem. We upgraded from Exchange 5.5 to 2000 a while back, and eventually got off of 5.5 and went native. We are also on Windows 2000 AD in native mode. Recently we added a second Exchange server and installed 2003. Our p...

"Protect Sheet" option
I have used this feature on some of my Excel files, and have since forgotten the password I used! (surprise,surprise) Is there any easy way to regain access to these files? take a look here: http://www.mcgimpsey.com/excel/removepwords.html In article <003f01c3bf4c$069a2190$a501280a@phx.gbl>, "Dave T" <anonymous@discussions.microsoft.com> wrote: > I have used this feature on some of my Excel files, and > have since forgotten the password I used! > (surprise,surprise) Is there any easy way to regain access > to these files? J.E. McGimpsey has a lin...