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);
}