Skip to main content
Nintex Community Menu Bar

ViewHistory - C#

  • January 11, 2022
  • 0 replies
  • 14 views
  • Translate

butlerj
Nintex Employee
Forum|alt.badge.img+20
// DocumentNOW V2 ViewHistory example  // force TLS 1.2 if .net < 4.6 ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;  Guid accountContextID = new Guid(<fromYourAccount>); Guid documentID = new Guid(<savedFromYourSubmission>); Guid authToken = new Guid(<savedFromYourSubmission>);  // assuming we set the namespace on the service proxy to DocNow ... DocNow.ViewHistoryServiceClient client = new DocNow.ViewHistoryServiceClient(); DocNow.DocumentHistoryView request = new DocNow.DocumentHistoryView();  request.Id = documentID;             request.AuthToken = authToken; request.ContextIdentifier = accountContextID; DocNow.DocumentHistoryViewResult[] historyresults = client.ViewHistory(new DocNow.DocumentHistoryView[] { request });  if (historyresults.Length > 0) {     if (historyresults[0].Exceptions != null)     {         StringBuilder sb = new StringBuilder();         foreach (DocNow.HistoryViewException exception in historyresults[0].Exceptions)         {             sb.AppendFormat("{0} : {1}{2}", exception.Severity.ToString(), exception.Value, Environment.NewLine);         } 	    Console.WriteLine(sb.ToString());     }     else     {         foreach(DocNow.DocumentEvent docevent in historyresults[0].Events)         {             Console.WriteLine($"{docevent.Date.ToString()} : {docevent.Details}");         }     } }

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings