UpdateSalesProcessHoldSetup


Description

Updates the specified sales process hold setup object, storing the current values in the database.

Parameters

Parameter

Type

Description

salesProcessHoldSetup

SalesProcessHoldSetup

The sales process hold setup object that is being updated.

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 retrieves the sales process hold setup with the sales process hold setup key value “ADDRESS” and sets the Description property to “Address Verification Hold”. The UpdateSalesProcessHoldSetup operation saves the new description and all the sales process hold setup object’s existing properties to the database.

 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;
			SalesProcessHoldSetupKey salesProcessHoldSetupKey;
			SalesProcessHoldSetup salesProcessHoldSetup;
			Policy salesProcessHoldSetupUpdatePolicy;

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

			// Be sure the default credentials are 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 object
			context.OrganizationKey = (OrganizationKey)companyKey;

			// Create a sales process hold setup key object
			salesProcessHoldSetupKey = new SalesProcessHoldSetupKey();
			salesProcessHoldSetupKey.Id = "ADDRESS";

			// Retrieve the specified sales process setup hold object
			salesProcessHoldSetup = wsDynamicsGP.GetSalesProcessHoldSetupByKey(
			salesProcessHoldSetupKey, context);

			// Update the description property of the sales process hold setup object
			salesProcessHoldSetup.Description = "Address Verification Hold";

			// Get the update policy for sales process hold setup objects
			salesProcessHoldSetupUpdatePolicy = wsDynamicsGP.GetPolicyByOperation(
			"UpdateSalesProcessHoldSetup", context);

			// Update the sales process hold object
			wsDynamicsGP.UpdateSalesProcessHoldSetup(salesProcessHoldSetup, 
			context, salesProcessHoldSetupUpdatePolicy);
	}
}
}

 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;
			SalesProcessHoldSetupKey salesProcessHoldSetupKey;
			SalesProcessHoldSetup salesProcessHoldSetup;
			Policy salesProcessHoldSetupUpdatePolicy;

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

			// Create a sales process hold setup key object
			salesProcessHoldSetupKey = new SalesProcessHoldSetupKey();
			salesProcessHoldSetupKey.Id = "ADDRESS";

			// Retrieve the specified sales process setup hold object
			salesProcessHoldSetup = wsDynamicsGP.GetSalesProcessHoldSetupByKey(
			salesProcessHoldSetupKey, context);

			// Update the description property of the sales process hold setup object
			salesProcessHoldSetup.Description = "Address Verification Hold";

			// Get the update policy for sales process hold setup objects
			salesProcessHoldSetupUpdatePolicy = wsDynamicsGP.GetPolicyByOperation(
			"UpdateSalesProcessHoldSetup", context);

			// Update the sales process hold object
			wsDynamicsGP.UpdateSalesProcessHoldSetup(salesProcessHoldSetup, 
			context, salesProcessHoldSetupUpdatePolicy);

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


Documentation Feedback