# attachap

### InaportGold and above only

### attachap(APcode), attachap(APcode, eventId)

Attaches the nominated Automated Process to the contact, and optionally setting the start event for the Process.

## Arguments

Argument | Data Type | Description
APcode | string | The Automated Process code to be added to the contact
eventId | string | The Id number for the event to start with. The default value is the first event of the Automated Process

## Returns

No value returned.

## Description

Adds the GoldMine Automated Process indicated by the APcode parameter to the contact. The start event for the Process can be specified by supplying a valid Event ID in the eventId parameter. This will result in the Automated Process starting at the specified Event ID rather than the first Event ID in the Events list. If no eventId parameter is supplied, the default value set is the first event of the Automated Process.

## Examples

Assume "100" is the Code of the Automated Process "NewInvoice"

Assume "200" is the code for NewInvoice Event "Phone Contact"

Assume 210 is the code for NewInvoice Event "Email Contact"

Example | Returns | Description
attachap("100") |  | Attaches the NewInvoice Automated Process to the contact, with "Phone Contact" as the first event
attachap("100","210") |  | Attaches the NewInvoice Automated Process to the contact, with "Email Contact" as the first event (i.e. skipping the "Phone Contact" event)

## See Also

addtogrp(), cleargrp(), makegrp(), removefromgrp(), removegrp()