PublishPackages() Method

You use the PublishPackages() method to publish multiple customization projects that exist in the database of an MYOB Acumatica instance.

Syntax

public void PublishPackages(string[] packageNames, bool mergeWithExistingPackages)

Parameters

  • packageNames: An array of names of the customization projects to be published.
  • mergeWithExistingPackages: An indicator of whether the specified customization projects must be merged with the customization projects that are currently published in the same instance of MYOB Acumatica. If the value of the parameter is true and there are published customization projects in the instance, the platform merges the content of the projects specified in the method with the content of the currently published projects and then applies the merged customization to the instance. If the value of the parameter is false, the platform cancels the currently applied customization and publishes only the projects specified in the method.

Example

The following code logs in to an MYOB Acumatica instance and publishes the package1, package2, and package3 customization projects that exist in the database of the instance.


var webserviceurl = "http://localhost/AcumaticaInstance/api/ServiceGate.asmx";
var username = "admin";
var password = "123";
var packageNames = new []{"package1", "package2", "package3"};
var mergeWithExistingPackages = true;

var client = new ServiceGate.ServiceGate
{
  Url = webserviceurl,
  CookieContainer = new CookieContainer(),
  Timeout = (int) TimeSpan.FromMinutes(5).TotalMilliseconds
};

var loginResult = client.Login(username, password);

if (loginResult.Code == ErrorCode.OK)
{
  client.PublishPackages(packageNames, mergeWithExistingPackages);
}

Usage Notes

If there are multiple tenants in an instance of MYOB Acumatica, this method affects the tenant to which the service is logged in. To log in to a specific tenant, add the tenant name to the user name using the following format: user@MyTenant.