CreateRecord

Operation which allows to create a record in Progression.
Currently, the types of Record creation supported are:

CLIENT

HUMAN_RESOURCE

NODE

PRODUCT

RESOURCE

TAG

TASK

TASK_ATTACHMENT

TASK_COMMENT

TASK_ITEM_LIST

TASK_SIGNATURE


Property

Type

Value

Credentials

Credentials

Authentication information

Record

Record

Record to create (see supported types above)

ParentRecordRef

RecordRef

The Parent Record.

Optional depending on the type created. i.e. : a TASK_ATTACHMENT type requires a parent TASK.

CreateRecordRequest



// Client Creation

CreateRecordRequest request = new CreateRecordRequest();

request.setCredentials(credentials);

Client client = new Client();

// Mandatory

client.setLabel("Client 123");

client.setLang("fr");

RecordRef clientTypeRef = new RecordRef();

clientTypeRef.setType(RecordType.CLIENT_TYPE);

clientTypeRef.setLabel("Billable Client ");

client.setTypeRef(clientTypeRef);

// Optional

Address clientAddress = new Address();

clientAddress.setAddress("123 street");

clientAddress.setCity("Montreal");

clientAddress.setCountry("CA");

clientAddress.setProvince("QC");

client.setAddress(clientAddress);

ArrayOfProperty properties = new ArrayOfProperty();

Property p = new Property();

p.setName("address.phone");

p.setValue("123-456-7890");

properties.getProperty().add(p);

client.setProperties(properties);

// Sending of request

request.setRecord(client);

RecordRef clientRef = progressionWebService.createRecord(request).getRecordRef();