MS Dynamics 365- Close Quote from C# / Custom action

Ankaprasad
Posted by Ankaprasad under C# category on | Points: 40 | Views : 2756
  string id = "d2b1ac82-b18a-ea11-a811-000d3a35bdc2";
int statusReason = 5;

// First activate quote
Entity party = new Entity("quote", new Guid(id));
party["statecode"] = new OptionSetValue(1); // status - Active
party["statuscode"] = new OptionSetValue(2); // status Reason - inprogress
service.Update(party);

// then close the quote
CloseQuoteRequest req = new CloseQuoteRequest();
Entity quoteClose = new Entity("quoteclose");
quoteClose.Attributes.Add("quoteid", new EntityReference("quote", new Guid(id)));
quoteClose.Attributes.Add("subject", "Customer was mean so we just closed it.");
req.QuoteClose = quoteClose;
req.RequestName = "CloseQuote";
OptionSetValue o = new OptionSetValue();
o.Value = statusReason;
req.Status = o;

CloseQuoteResponse resp = (CloseQuoteResponse)service.Execute(req);

Comments or Responses

Posted by: Sunny0903 on: 7/1/2021 Level:Starter | Status: [Member] | Points: 10
See discount codes applicable to online stores here https://www.couponxoo.com/400-robux-gift-card-code
Posted by: Sunny0903 on: 7/2/2021 Level:Starter | Status: [Member] | Points: 10
MS Dynamics 365- Custom action - Read input parameter values from plugin. Ankaprasad. Posted by Ankaprasad under C# category on 8/24/2020 | Points: 40 | Views : 2118. Post Code | Search Codes ... Entity party = new Entity("quote", new Guid(id)); ... Add("subject", "Customer was mean so we just closed it."); req.
https://www.couponxoo.com/free-400-robux-code

Login to post response