Dynamics GP API

Overview

These public interfaces are used in Dynamics GP components. They are provided for implementing advanced functionality in your scripts. In order for you to use these interfaces in your project, you have to reference CozyRoc.SSISPlus.dll and CozyRoc.Dynamics.dll libraries. Also include CozyRoc.Dynamics.Gp and CozyRoc.Dynamics.Gp.Service namespaces.

IConnection / IGpConnection

When you call Dynamics GP Connection Manager AcquireConnection method, it returns object implementing IConnection interface. This is the interface used for interaction with Dynamics GP service.

Connect method

Connects to Dynamics GP service.

Close method

Closes the connection to Dynamics GP service. Use always after you finish working with the service.

IsConnected method

Returns true if connected to the service.

GetService method

Get Dynamics GP web service object.

GetContext method

Get Dynamics GP context object.

GetCompanies method

Returns list of available companies.

GetObjectList method

Gets objects list for specific operation. These are the method parameters:

  • operation (uint) – It can be one of the options listed in the following table.

    Value Description
    0 Return objects, which can be completely read.
    1 Return objects, which support summary read.
    2 Return objects, which support record creation.
    3 Return objects, which can be updated.
    4 Return objects, which permit record removal.
    5 Return objects, which permit record void.

GetCompositeObjectList method (1.6 SR-1)

Gets specified object composite objects list. These are the method parameters:

  • root (string) – object name.

GetObject method

Get object used to manipulate Dynamics GP object. The method returns IObject object. These are the method parameters:

  • name (string) – object name.

ServerHost property (string)

Specify the name or IP address of the Dynamics GP server.

ServerUser property (string)

Specify user name to access the Dynamics GP service.

ServerPassword property (string)

Specify user password to access the Dynamics GP service.

CompanyName property (string)

Specify company name.

ServerTimeout property (int)

Specify the number of seconds before timing out session connect. The default value of this property is 100 seconds.

WorkOnBehalfOf property (string)

Specify if you want to use the security settings for a different user, other than the user setup in your credentials. The default value is empty.

CultureName property (string)

Specify culture in use. It should be in the format en-US. Based on the selected culture, the service will return data in format specific to it.

CurrencyType (int)

Specify how currency information is handled. This property has the options listed in the following table.

Value Description
0 The transaction currency amount will be used (default).
1 The local currency amount will be used.

RoleId property (string)

Specify role used for policy and behavior options. If not specified, the default role will be used.

RetainSameConnection property (bool)

Specify if all clients should use the same connection. This property has the options listed in the following table.

Value Description
True All clients use same connection (default).
False Every client uses different connection.

ProxyHost property (string)

Specify the name or IP address of the proxy server.

ProxyPort property (int)

Specify the port number on the proxy server to use for the connection.

ProxyUser property (string)

Specify user name to access the proxy server.

ProxyPassword property (string)

Specify password to access the proxy server.

IProperty / IGpProperty

This interface is used to retrieve Dynamics GP object property information.

Name property (string)

Returns property name.

IsKey property (bool)

Returns true if property is object key.

PropertyType property (DataType)

Returns property type.

Length property (int)

Returns property length.

Precision property (int)

Returns property precision.

Scale property (int)

Returns property scale.

IObject / IGpObject

This interface is used for Dynamics GP object management.

GetProperties method

Get object properties. The method returns array of IProperty objects. These are the method parameters:

  • summary (bool) – if true, the summary object properties are returned. Otherwise it will return the complete object properties.

NewObject method

Constructs Dynamics GP object instance. These are the method parameters:

  • summary (bool) – if true, summary object is returned. Otherwise it will return the complete object.

SetPropertyValue method

Sets property value in Dynamics GP object. These are the method parameters:

  • instance (object) – Dynamics GP object instance.
  • property (string) – property name.
  • value (object) – property value.

GetPropertyValue method

Returns property value from Dynamics GP object. These are the method parameters:

  • instance (object) – Dynamics GP object instance.
  • property (string) – property name.

GetObjectById method

Retrieves Dynamics GP object. These are the method parameters:

  • id (object) – object identifier.

GetData method

Retrieves objects from Dynamics GP service. These are the method parameters:

  • criteriaXML (string)XML string of Dynamics GP restriction.
  • summary (bool) – if true, summary objects are returned. Otherwise it will return the complete objects.

GetCompositeData method

Retrieves records of composite object. These are the method parameters:

  • instance (object) – instance to main Dynamics GP object.
  • key (string) – parent object key. Multiple keys are separated with semicolon (;).

Create method

Creates record in object. These are the method parameters:

  • instance (object) – Dynamics GP object instance with create data.

Update method

Updates existing record in object. These are the method parameters:

  • instance (object) – Dynamics GP object instance with update data.

UpdateComposite method

Updates records in composite object. These are the method parameters:

  • instance (object) – instance to main Dynamics GP object.
  • key (string) – parent object key. Multiple keys are separated with semicolon (;).
  • list (object array) – array of composite Dynamics GP objects.

Delete method

Deletes record in object. These are the method parameters:

  • id (object) – identifier of record to delete.

Void method

Voids record in object. These are the method parameters:

  • id (object) – identifier of record to void.

Name property (string)

Returns the object name.

IsComposite property (bool)

Returns true if composite object.