Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Error:the quote cannot be activated because it is not in draft state

$
0
0

Hi all,

I want to activate my quote using custom plugin.But Its giving error that THE QUOTE CANNOT BE ACTIVATED BECAUSE IT IS NOT IN DRAFT STATE..But that quote is in Draft State only..Please suggest me what's the wrong in that.Here I attach my code also

 Guid QuoteId = ((Entity)Context.InputParameters["Target"]).Id;

try
{
SetStateRequest activatequote = new SetStateRequest();
activatequote.EntityMoniker = new EntityReference("quote", QuoteId);
activatequote.State = new OptionSetValue((int)QuoteState.Active);
activatequote.Status = new OptionSetValue(2);
SetStateResponse response = (SetStateResponse)Service.Execute(activatequote);

}
catch (Exception e)
{
throw new InvalidPluginExecutionException("An error occured" + e);
}


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>