SetStateQuoteRequest Function
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 =NewSystem.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,NewAllColumns)
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, "Error")
End Try
End Function
End Class
|
<<Back