DeleteApplicantApplication


Description

Deletes an applicant application object based on the key value supplied.

Parameters

Parameter

Type

Description

businessObjectKey

ApplicantSequenceKey

The applicant sequence key object that specifies the applicant application to delete.

context

Context

Specifies information about how the method will be called.

policy

Policy

Specifies the set of behaviors and behavior options to be applied during the operation.


Interfaces

 

Examples

The following C# example deletes the applicant application where the applicant key Id value is “1” and the application sequence Id is “1”.

 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;
			ApplicantKey applicantKey;
			SequenceKey sequenceKey;
			ApplicantSequenceKey applicantSequenceKey;
			Policy applicantApplicationDeletePolicy;

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

			// Be sure that default credentials are being used
			wsDynamicsGP.UseDefaultCredentials = true;

			// Create a context 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
			context.OrganizationKey = (OrganizationKey)companyKey;

			// Create an applicant key
			applicantKey = new ApplicantKey();
			applicantKey.Id = 1;

			// Create a sequence key
			sequenceKey = new SequenceKey();
			sequenceKey.Id = 1;

			// Create an applicant sequence key
			applicantSequenceKey = new ApplicantSequenceKey();
			applicantSequenceKey.ApplicantKey = applicantKey;
			applicantSequenceKey.SequenceKey = sequenceKey;

			// Get the delete policy for the applicant application objects
			applicantApplicationDeletePolicy = wsDynamicsGP.GetPolicyByOperation(
				"DeleteApplicantApplication", context);

			// Delete the applicant application object
			wsDynamicsGP.DeleteApplicantApplication(applicantSequenceKey,
				context, applicantApplicationDeletePolicy);
	}
}
}

 Native endpoint

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

namespace DynamicsGPWebServiceSample
{
	class Program
	{
		static void Main(string[] args)
		{
			CompanyKey companyKey;
			Context context;
			ApplicantKey applicantKey;
			SequenceKey sequenceKey;
			ApplicantSequenceKey applicantSequenceKey;
			Policy applicantApplicationDeletePolicy;

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

			// Create a context 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
			context.OrganizationKey = (OrganizationKey)companyKey;

			// Create an applicant key
			applicantKey = new ApplicantKey();
			applicantKey.Id = 1;

			// Create a sequence key
			sequenceKey = new SequenceKey();
			sequenceKey.Id = 1;

			// Create an applicant sequence key
			applicantSequenceKey = new ApplicantSequenceKey();
			applicantSequenceKey.ApplicantKey = applicantKey;
			applicantSequenceKey.SequenceKey = sequenceKey;

			// Get the delete policy for the applicant application objects
			applicantApplicationDeletePolicy = wsDynamicsGP.GetPolicyByOperation(
				"DeleteApplicantApplication", context);

			// Delete the applicant application object
			wsDynamicsGP.DeleteApplicantApplication(applicantSequenceKey,
				context, applicantApplicationDeletePolicy);

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


Documentation Feedback