Compartilhar via


DeleteAllLoggedExceptionData

Description

Deletes all exceptions from the log.

Parameters

Parameter

Type

Description

context

Context

Specifies information about how the method will be called.

Interfaces

  • Dynamics GP
  • Common
  • Field Service
  • Financials
  • Human Resources/Payroll
  • Inventory
  • Manufacturing
  • Project Accounting
  • Purchasing
  • Sales

Examples

The following C# example deletes all exceptions from the log.

Cc508576.LegacyEndpoint(en-us,MSDN.10).gif** Legacy endpoint**

using System;
using System.Collections.Generic;
using System.Text;
using DynamicsGPWebServiceSample.DynamicsGPService;

namespace DynamicsGPWebServiceSample
{
    class Program
    {
        static void Main(string[] args)
        {
            CompanyKey companyKey;
            Context context;

            // Create an instance of the service
            DynamicsGP wsDynamicsGP = new DynamicsGP();

            // Be sure the 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 company)
            companyKey = new CompanyKey();
            companyKey.Id = (-1);

            // Set up the context object
            context.OrganizationKey = (OrganizationKey)companyKey;

            // Delete all the exception in the exception log
            wsDynamicsGP.DeleteAllLoggedExceptionData(context);
        }
    }
}

Cc508576.NativeEndpoint(en-us,MSDN.10).gif** Native endpoint **

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using DynamicsGPWebServiceSample.DynamicsGPService;

namespace DynamicsGPWebServiceSample
{
    class Program
    {
        static void Main(string[] args)
        {
            CompanyKey companyKey;
            Context context;

            // 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 company)
            companyKey = new CompanyKey();
            companyKey.Id = (-1);

            // Set up the context object
            context.OrganizationKey = (OrganizationKey)companyKey;

            // Delete all the exception in the exception log
            wsDynamicsGP.DeleteAllLoggedExceptionData(context);

            // Close the service
            if(wsDynamicsGP.State != CommunicationState.Faulted)
            {
                wsDynamicsGP.Close();
            }
        }
    }
}