Microsoft CRM Houston
(800) 892-6143

Your Full Name:                  Your e-mail                   Comments

Implementation & Customization

Change the status and status reason of a quote from Draft to Active using CRM Web Service

Imports SetQuoteState.CrmSdk

Imports System

Public Class SetQuoteState

'Public Shared Function SetQuoteStatus(ByVal QuoteId As Guid)

Public Shared Function SetQuoteStatus()

Try

Dim theService As New CrmService

theService.Credentials = New System.Net.NetworkCredential("yourUserName", "yourPassword", "yourDomain")

theService.Url = "HTTP://yourCrmServer/mscrmservices/2006/crmservice.asmx"

Dim theQuote As New quote

Dim tempid As New Guid("E66E0BF5-5DA7-DC11-8A87-001C23C53D17")

theQuote = theService.Retrieve(EntityName.quote.ToString, tempid, New AllColumns)

Dim NewSr As New SetStateQuoteRequest

NewSr.EntityId = theQuote.quoteid.Value

NewSr.QuoteState = QuoteState.Active

NewSr.QuoteStatus = 12

Dim response As New SetStateQuoteResponse

response = theService.Execute(NewSr)

Catch ex As System.Web.Services.Protocols.SoapException

MsgBox(ex.Detail.InnerXml, MsgBoxStyle.Information, "Errror")

End Try

End Function

End Class

 

Training
Microsoft CRM 101
Microsoft CRM for Outlook
Microsoft CRM Advanced Find
Microsoft CRM Reports
Microsoft CRM Database
Microsoft CRM Web Services
Microsoft CRM JavaScript
Microsoft CRM Add-ons
Microsoft CRM Resources
Microsoft CRM Callouts
Microsoft CRM Workflow