Skip to content

Instantly share code, notes, and snippets.

@synesthesia
Created February 3, 2017 10:05
Show Gist options
  • Save synesthesia/1adf51acf4d111d27b3da1d54ba298c8 to your computer and use it in GitHub Desktop.
Save synesthesia/1adf51acf4d111d27b3da1d54ba298c8 to your computer and use it in GitHub Desktop.
var invoiceEntity = new Entity(Invoice.EntityLogicalName) { Id = invoiceRef.Id };
// do not attempt to set the statecode - if you do this code will fire workflows twice
// invoiceEntity["statecode"] = new OptionSetValue((int)InvoiceState.Active);
invoiceEntity["statuscode"] = new OptionSetValue((int)invoice_statuscode.ReadyToIssue);
tracingService.Trace("Update invoice status to Ready To Issue, Id:{0}", invoiceEntity.Id);
service.Update(invoiceEntity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment