Accounting Apex API Developer Reference

c2g.DocumentCreatePxService

global with sharing class DocumentCreatePxService

This service class provides document creation functionality. Only journals, cash entries, sales credit notes, sales invoices, payable invoices and payable credit notes are currently supported.

Methods

createSyncWithResponse

global static c2g.DocumentCreatePxService.Response createSyncWithResponse(List<c2g.DocumentCreatePxService.Document> documents)

This service allows you to create documents synchronously.

Input Parameters

Name Type Description
documents List<c2g.DocumentCreatePxService.Document> Holds the component records for each document to create.

Return Value

The response with either the IDs of the document headers created or the list of errors.

createSync

global static Set<ID> createSync(List<c2g.DocumentCreatePxService.Document> documents)

This service allows you to create documents synchronously.

Input Parameters

Name Type Description
documents List<c2g.DocumentCreatePxService.Document> Holds the component records for each document to create.

Return Value

The IDs of the document headers created.

createAsync

global static ID createAsync(List<c2g.DocumentCreatePxService.Document> documents)

This service allows you to create documents asynchronously using an Apex Job. The createAsync method can handle larger documents than the createSync method.

Input Parameters

Name Type Description
documents List<c2g.DocumentCreatePxService.Document> Holds the component records for each document to create.

Return Value

The ID of the async job. This can be monitored from the "Apex Jobs" page.

c2g.DocumentCreatePxService.Document

global virtual with sharing class Document

A container for the records that make up a document.

Properties

Name Type Description
header SObject The document header.
lines List<SObject> The document lines.
expenseLines List<SObject> The document expenseLines.

Methods

Document

global Document(SObject header, List<SObject> lines)

The document constructor.

Document

global Document(SObject header, List<SObject> lines, List<SObject> expenseLines)

The document constructor with multiple line type.

c2g.DocumentCreatePxService.Response

global with sharing class Response

Response returned by createSyncWithResponse method.

Properties

Name Type Description
documentIDs Set<ID> IDs of the documents created.
errors List<c2g.DocumentCreatePxService.Error> List of errors in documents creation.

Methods

Response

global Response()

The response constructor.

Response

global Response(Set<ID> documentIDs, List<c2g.DocumentCreatePxService.Error> errors)

The response constructor with document IDs and errors.

c2g.DocumentCreatePxService.Error

global with sharing class Error

An error returned in the response.

Properties

Name Type Description
errorMessage String Error message.
objectName String Object name.
fieldName String Field name.
fieldLabel String Field label.
index Integer Record index.

Methods

Error

global Error()

The error constructor.

Error

global Error(String errorMessage, String objectName, String fieldName, Integer index)

The error constructor with error message, object name, field name and index.

Error

global Error(String errorMessage, String objectName, String fieldName, String fieldLabel, Integer index)

The error constructor with error message, object name, field name, field label and index.

Error

global Error(String errorMessage, Schema.sObjectField sobjField, Integer index)

The error constructor with error message, sobject field and index.

© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.