Retrieves a list of exception summary objects that were logged between the specified dates.
Parameter |
Type |
Description |
---|---|---|
beginDate |
A date/time object that specifies which exception summaries are to be retrieved. The LoggedDate property of all retrieved exception summary objects will be equal to or later than the specified date and time value. |
|
endDate |
A date/time object that specifies which exception summaries are to be retrieved. The LoggedDate property of all retrieved exception summary objects will be earlier than the specified date and time value. |
|
context |
Specifies information about how the method will be called. |
Value |
Type |
Description |
---|---|---|
GetLoggedExceptionDataListResult |
A list of logged exception summary objects between the specified begin and end dates. |
The following C# example retrieves the list of exception summaries logged between two dates, and displays the number in a message box. To use this example, the begin and end date values should be changed to reflect exception log activity.
Legacy endpoint
using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using DynamicsGPWebServiceSample.DynamicsGPService; namespace DynamicsGPWebServiceSample { class Program { static void Main(string[] args) { CompanyKey companyKey; Context context; DateTime beginDate; DateTime endDate; LoggedExceptionDataSummary[] exceptionSummaryList; // Create an instance of the service DynamicsGP wsDynamicsGP = new DynamicsGP(); // Be sure that default credentials are being used wsDynamicsGP.UseDefaultCredentials = true; // Create a context object with which to call the service context = new Context(); // Specify which company to use (sample comany) companyKey = new CompanyKey(); companyKey.Id = (-1); // Set up the context object context.OrganizationKey = (OrganizationKey)companyKey; // Specify the start and end dates beginDate = new DateTime(2006, 1, 18); endDate = new DateTime(2006, 1, 20); // Retrieve the list of exception summaries exceptionSummaryList = wsDynamicsGP.GetLoggedExceptionDataList(beginDate, endDate, context); // Display the number of exception summaries matching the criteria MessageBox.Show("Number of exceptions logged = " + exceptionSummaryList.Length.ToString()); } } }
Native endpoint
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using DynamicsGPWebServiceSample.DynamicsGPService; namespace DynamicsGPWebServiceSample { class Program { static void Main(string[] args) { CompanyKey companyKey; Context context; DateTime beginDate; DateTime endDate; LoggedExceptionDataSummary[] exceptionSummaryList; // Create an instance of the service DynamicsGPClient wsDynamicsGP = new DynamicsGPClient(); // Create a context object with which to call the service context = new Context(); // Specify which company to use (sample comany) companyKey = new CompanyKey(); companyKey.Id = (-1); // Set up the context object context.OrganizationKey = (OrganizationKey)companyKey; // Specify the start and end dates beginDate = new DateTime(2006, 1, 18); endDate = new DateTime(2006, 1, 20); // Retrieve the list of exception summaries exceptionSummaryList = wsDynamicsGP.GetLoggedExceptionDataList(beginDate, endDate, context); // Display the number of exception summaries matching the criteria MessageBox.Show("Number of exceptions logged = " + exceptionSummaryList.Length.ToString()); // Close the service if(wsDynamicsGP.State != CommunicationState.Faulted) { wsDynamicsGP.Close(); } } } }