Accounting API Developer's Reference

c2g.DataViewService

global with sharing class DataViewService

Encapsulates all service layer logic for the Dataview functionality. For more guidelines and details see https://developer.salesforce.com/page/Apex_Enterprise_Patterns_-_Service_Layer

Methods

createNewDataView

global static c2g.DataViewService.DataView createNewDataView()

Creates a dataview object with no input parameters.

Return Value

This service returns a c2g.DataViewService.DataView object.

getDataView

global static List<c2g.DataViewService.DataView> getDataView(Set<ID> dataViewIds)

Retrieves the specified dataviews.

Input Parameters

Name Type Description
dataViewIds Set<ID> Identifies the dataviews that you want to retrieve.

Return Value

This service returns a list of c2g.DataViewService.DataView objects.

getDataView

global static List<c2g.DataViewService.DataView> getDataView(Set<ID> dataViewIds, Boolean isDataviewMaster)

Retrieves the specified dataviews.

Input Parameters

Name Type Description
dataViewIds Set<ID> Identifies the dataviews that you want to retrieve.
isDataviewMaster Boolean Set this to True in order to load the “in use” flags to see where the dataview is being used.

Return Value

This service returns a list of c2g.DataViewService.DataView objects.

save

global static List<ID> save(List<c2g.DataViewService.DataView> dataViews)

Saves the specified dataviews.

Input Parameters

Name Type Description
dataViews List<c2g.DataViewService.DataView> Identifies the dataviews to be saved.

Return Value

This service returns a list of ID objects.

getDataViewMetadata

global static Map<String, c2g.CommonService.ObjectMetadata> getDataViewMetadata(Set<Id> dataViewIds)

Retrieves all the metadata required by the specified dataviews.

Input Parameters

Name Type Description
dataViewIds Set<Id> Identifies the dataviews of interest.

Return Value

This service returns a map of String, CommonService.ObjectMetadata objects.

getDataViewMetadata

global static Map<String, c2g.CommonService.ObjectMetadata> getDataViewMetadata(Set<Id> dataViewIds, Boolean throwException)

Retrieves all the metadata required by the specified dataviews.

Input Parameters

Name Type Description
dataViewIds Set<Id> Identifies the dataviews of interest.
throwException Boolean Indicates whether or not exceptions will be thrown.

Return Value

This service returns a map of String, CommonService.ObjectMetadata objects.

getAllFields

global static List<c2g.CommonService.Identity> getAllFields(Set<ID> dataviewIds)

Retrieves a list of all the fields on the specified dataviews.

Input Parameters

Name Type Description
dataviewIds Set<ID> Identifies the dataviews of interest.

Return Value

This service returns a list of CommonService.Identity objects.

deleteDataView

global static void deleteDataView(Set<Id> dataViewIds)

Deletes the specified dataviews.

Input Parameters

Name Type Description
dataViewIds Set<Id> Identifies the dataviews to be deleted.

getActionClasses

global static List<String> getActionClasses()

Input Parameters

Name Type Description

Return Value

c2g.DataViewService.DataView

global class DataView

Holds a dataview. See "What is a Dataview?" in the FinancialForce Help for more details.

Properties

Name Type Description
Id Id Globally unique string that identifies the record.
Name String The dataview's descriptive name.
StartingObject String The dataview's primary object.
Fields List<c2g.DataViewService.Field> Holds details of any fields added to the dataview.
Joins List<c2g.DataViewService.DataViewJoin> Holds details of any joins defined on the dataview.
Actions List<c2g.DataViewService.Action> Holds details of any actions defined on the dataview.

Methods

DataView

global DataView()

Creates an API version of an empty dataview object.

DataView

global DataView(c2g__DataView__c sObj)

Creates an API version of a dataview object using the specified parameters.

Input Parameters

Name Type Description
sObj c2g__DataView__c Contains the SObject version of the dataview object.

createSObject

global c2g__DataView__c createSObject()

Creates an SObject version of the dataview instance from its API version.

c2g.DataViewService.Field

global class Field

Holds details of a field that has been added to a dataview. See "What is a Dataview?" in the FinancialForce Help for more details.

Properties

Name Type Description
Id Id Globally unique string that identifies the record.
Source String The source object that the field belongs to.
Name String The field name.
ObjectField String The system name for this field.
CommonName String The common name assigned to this field (if any).
Presentable Boolean Indicates if the field is presentable.
Aggregatable Boolean When True, indicates that values can be aggregated. Only available for numeric fields. If you set this to True for an existing field which is in use on a summarization template, you might want to change the field's summarization method to SUM on the summarization template.
Reversible Boolean When True, indicates that values can be shown with reverse sign. Only available for numeric fields.
Selectable Boolean Indicates if the field is selectable.
TransposeItems List<c2g.DataViewService.TransposeItem> Holds transpose details for this field (if any).
InquiryTemplatesWhereIsInUse List<String> A list of inquiry templates that use this field.
SummarizationTemplatesWhereIsInUse Set<String> A list of summarization templates that use this field.
KeyPriority Integer Set to 1 if this field is the key field in the dataview. Otherwise set to 0.

Methods

Field

global Field()

Creates an API version of an empty dataview field object.

Field

global Field(c2g__DataViewField__c sObj)

Creates an API version of a dataview field object using the specified parameters.

Input Parameters

Name Type Description
sObj c2g__DataViewField__c Contains the SObject version of the dataview field object.

createSObject

global c2g__DataViewField__c createSObject()

Creates an SObject version of the dataview field instance from its API version.

c2g.DataViewService.TransposeItem

global class TransposeItem

Holds a transpose mapping of value to field.

Properties

Name Type Description
Id Id Globally unique string that identifies the record.
Value String The value of the Transpose On field that you want to associate with a particular source object field.
Source String The source object containing the field that you want to associate with the specified value.
ObjectField String The object field that you want to associate with the specified value.

Methods

TransposeItem

global TransposeItem()

Creates an API version of an empty transpose item object.

TransposeItem

global TransposeItem(c2g__DataViewTransposeItem__c sObj)

Creates an API version of an empty transpose item object.

Input Parameters

Name Type Description
sObj c2g__DataViewTransposeItem__c Contains the SObject version of the transpose item object.

createSObject

global c2g__DataViewTransposeItem__c createSObject()

Creates an SObject version of the dataview transpose item instance from its API version.

c2g.DataViewService.DataViewJoin

global class DataViewJoin

Holds details of a dataview join. See "What is a Dataview?" in the FinancialForce Help for more details.

Properties

Name Type Description
Id Id Globally unique string that identifies the record.
Name String The join name.
RelationshipName String The name that identifies the relationship between the two objects in Salesforce.
RelatedObject String Identifies the related object.
Depth Decimal Joins are displayed in an hierarchical tree structure. This indicates at what level in the tree structure this join exists.
Index Decimal A sequential number that identifies the join's position in the list.
Type String Indicates if the join is a lookup join or a relationship join.
ParentName String The name of the parent object.
Expanded Boolean Indicates whether or not the tree structure is expanded.
HasInvalidRelationship Boolean Indicates if the joined object has an invalid relationship with the parent.
Filters List<c2g.DataViewService.DataViewJoinFilter> Holds details of the join filter if one has been defined on the join.

Methods

DataViewJoin

global DataViewJoin()

Creates an API version of an empty dataview join object.

DataViewJoin

global DataViewJoin(c2g__DataViewJoin__c sObj, Schema.DescribeSObjectResult relatedObj)

Creates an API version of a dataview join object using the specified parameters.

Input Parameters

Name Type Description
sObj c2g__DataViewJoin__c Contains the SObject version of the dataview join object.
relatedObj Schema.DescribeSObjectResult The 'child' object in this join.

createSObject

global c2g__DataViewJoin__c createSObject()

Creates an SObject version of the dataview join instance from its API version.

c2g.DataViewService.DataViewJoinFilter

global class DataViewJoinFilter

Holds details of a join filter that has been applied to a relationship join. See "What is a Dataview?" in the FinancialForce Help for more details.

Properties

Name Type Description
Id Id Globally unique string that identifies the record.
Name String System-generated name.
Operator String The operator to use in this condition.
Field String The field used in this condition.
FromValue String If the operator is In Range or Not in Range, this is the From Value to apply.
ToValue String The value to apply to the condition. If the operator is In Range or Not in Range, this is the To Value.
OpeningBrackets Decimal The number of opening brackets.
ClosingBrackets Decimal The number of closing brackets.
CombineType String Indicates if this is an AND or OR condition.

Methods

DataViewJoinFilter

global DataViewJoinFilter()

Creates an API version of an empty dataview join filter object.

DataViewJoinFilter

global DataViewJoinFilter(c2g__DataViewJoinFilter__c sObj)

Creates an API version of a dataview join filter object using the specified parameters.

createSObject

global c2g__DataViewJoinFilter__c createSObject()

Creates an SObject version of the dataview join filter instance from its API version.

c2g.DataViewService.Action

global class Action

Holds details of an action that has been configured on a dataview. See "What is a Dataview?" in the FinancialForce Help for more details.

Properties

Name Type Description
Id Id Globally unique string that identifies the record.
Name String The name given to the action.
ApexClass String
Description String The description given to the action.
Parameter String A parameter (optional) that needs to be passed to the Apex class that performs the action.
IsSingleSelect Boolean Indicates that only one row must be selected.
ParameterMetadataList List<c2g.DataViewService.ParameterMetadataType> Holds one or more parameters that the user needs to complete at runtime.

Methods

Action

global Action()

Creates an API version of an empty action object.

Action

global Action(c2g__DataViewAction__c sObj, Boolean singleSelect, List<c2g.DataViewService.ParameterMetadataType> metadataList)

Creates an API version of an action object using the specified parameters.

Input Parameters

Name Type Description
sObj c2g__DataViewAction__c Contains the SObject version of the action object.
singleSelect Boolean Indicates if this action is the type where only one row must be selected.
metadataList List<c2g.DataViewService.ParameterMetadataType> Holds any parameters that the user needs to complete at runtime.

createSObject

global c2g__DataViewAction__c createSObject()

Creates an SObject version of the dataview action instance from its API version.

c2g.DataViewService.SelectionOption

global class SelectionOption

Holds details of any selection options offered for a parameter.

Properties

Name Type Description
Key String A key to identify the selection option.
Label String A label for the selection option.

Methods

SelectionOption

global SelectionOption()

Creates an API version of an empty selection option object.

SelectionOption

global SelectionOption(String key, String label)

Creates an API version of an empty selection option object.

Input Parameters

Name Type Description
key String A key to identify the selection option.
label String A label for the selection option.

c2g.DataViewService.ParameterMetadataType

global class ParameterMetadataType

Holds a parameter that the user needs to complete at runtime when invoking an action from within Online Inquiries.

Properties

Name Type Description
Key String A key to identify the parameter.
Label String A label that informs the user what information he needs to supply.
Type String The datatype of the information that the user needs to supply.
Value String The parameter's value.
ReadOnly Boolean Indicates that the parameter is read-only.
SelectionOptions List<c2g.DataViewService.SelectionOption> Holds details of any selection options offered for the parameter.

Methods

ParameterMetadataType

global ParameterMetadataType()

Creates an API version of an empty parameter metadata object.

ParameterMetadataType

global ParameterMetadataType(String key, String label, String type)

Creates an API version of a parameter metadata object using the specified parameters.

Input Parameters

Name Type Description
key String A key to identify the parameter.
label String A label for the parameter.
type String The datatype of the parameter.

ParameterMetadataType

global ParameterMetadataType(String key, String label, String type, String value, Boolean readOnly, List<c2g.DataViewService.SelectionOption> selectionOptions)

Creates an API version of a parameter metadata object using the specified parameters.

Input Parameters

Name Type Description
key String A key to identify the parameter.
label String A label for the parameter.
type String The datatype of the parameter.
value String The parameter's value.
readOnly Boolean Indicates if the parameter is read-only.
selectionOptions List<c2g.DataViewService.SelectionOption> Holds any selection options offered for the parameter.