ERP Apex API Developer Reference

fferpcore.LinkControlBody

global virtual class LinkControlBody

fferpcore.Message sent by fferpcore.LinkingMessageHandler to the sender of the original message.

Properties

Name Type Description
STATE_OK String A constant used to determine when a message has been sent successfully.
STATE_ERROR String A constant used to determine when a message has encountered an error while sending.
FIELD_NAME_OUTGOING_LINK_CONTROL_FIELDS String Field Name for the map that containst the outgoing link control fields
FIELD_NAME_LINKED_OBJECT_ID String Field name for the linked object's ID.
FIELD_NAME_LINK_DEVELOPER_NAME String Field name for the sender's DeveloperName.
FIELD_NAME_LINK_STATE String Field name for the link state.
FIELD_NAME_LINK_ERROR_BODY String Field name for the erp error body.
FIELD_NAME_LINK_DESCRIPTION String Field name for the linked object description.

Methods

LinkControlBody

global LinkControlBody()

Creates an empty LinkControlBody.

serialize

global String serialize()

Converts the fferpcore.LinkControlBody into a JSON string.

Return Value

This service returns a string object.

deserialize

global static fferpcore.LinkControlBody deserialize(String jsonString)

Convert the given JSON string into a LinkControlBody.

Input Parameters

Name Type Description
jsonString String JSON string to be converted.

Return Value

This service returns a LinkControlBody object.

createInstance

global static fferpcore.LinkControlBody createInstance()

Not used outside unit tests. Use constructor instead.

withStateOk

global fferpcore.LinkControlBody withStateOk()

Indicates that the linked object was successfully created or updated.

Return Value

This service returns an LinkControlBody object.

withStateError

global fferpcore.LinkControlBody withStateError()

Indicates that an error occurred when creating or updating the linked object.

Return Value

This service returns an LinkControlBody object.

withLinkedObjectId

global fferpcore.LinkControlBody withLinkedObjectId(Id linkedObjectId)

Specifies the ID of the linked object.

Input Parameters

Name Type Description
linkedObjectId Id ID of the linked object.

Return Value

This service returns an LinkControlBody object.

withLinkId

global virtual fferpcore.LinkControlBody withLinkId(String linkId)

Specify the ID of the linked target.

Input Parameters

Name Type Description
linkId String The ID of the linked target.

Return Value

The original instance to allow fluent method calls.

withLinkDeveloperName

global fferpcore.LinkControlBody withLinkDeveloperName(String linkDeveloperName)

Specifies a developer name to identify the link.

Input Parameters

Name Type Description
linkDeveloperName String Developer name of the link.

Return Value

This service returns an LinkControlBody object.

withDescription

global fferpcore.LinkControlBody withDescription(String description)

Specifies the description of the link.

Input Parameters

Name Type Description
description String Description of the link.

Return Value

This service returns an LinkControlBody object.

withErrorMessage

global fferpcore.LinkControlBody withErrorMessage(String errorMessage)

Indicates an error occurred and specifies a single associated error message.

Input Parameters

Name Type Description
errorMessage String Error message concerning link.

Return Value

This service returns an LinkControlBody object.

withErrorMessages

global fferpcore.LinkControlBody withErrorMessages(List<String> errorMessages)

Indicates an error occurred and specifies multiple associated error messages.

Input Parameters

Name Type Description
errorMessages List<String> Error messages concerning the link.

Return Value

This service returns an LinkControlBody object.

withErrorBody

global fferpcore.LinkControlBody withErrorBody(fferpcore.ErpErrorBody errorBody)

Indicates an error occurred and specifies an associated error body.

Input Parameters

Name Type Description
errorBody fferpcore.ErpErrorBody Error body concerning the link.

Return Value

This service returns an LinkControlBody object.

getOutgoingDescriptionNode

global static fferpcore.MessageDescription.Node getOutgoingDescriptionNode(Schema.SObjectType context, String linkDeveloperName)

Generates a node for use within a fferpcore.MessageDescription to describe an outgoing link control body within a message.

Input Parameters

Name Type Description
context Schema.SObjectType Type of the source object for the link.
linkDeveloperName String Developer name of the link.

Return Value

This service returns an MessageDescription.Node object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

new fferpcore.MessageDescription(
    new fferpcore.Context.SObjectSource(SomeObject__c.CorrelationId__c),
    fferpcore.LinkControlBody.getOutgoingDescriptionNode(SomeObject__c.SObjectType, 'SO_Link'),
    new fferpcore.Context.SObjectContext(SomeObject__c.SObjectType));

getResponseDescriptionNode

global static fferpcore.MessageDescription.Node getResponseDescriptionNode(Schema.SObjectType context, String linkDeveloperName)

Generates a node for use within a fferpcore.MessageDescription to describe a responding link control body within a message.

Input Parameters

Name Type Description
context Schema.SObjectType Type of the linked object.
linkDeveloperName String Developer name of the object.

Return Value

This service returns an MessageDescription.Node object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

new fferpcore.MessageDescription(
    new fferpcore.Context.SObjectSource(SomeObject__c.CorrelationId__c),
    fferpcore.LinkControlBody.getResponseDescriptionNode(SomeObject__c.SObjectType, 'SO_Link'),
    new fferpcore.Context.SObjectContext(SomeObject__c.SObjectType));

getState

global String getState()

Gets the state of the link, either 'Ok' or 'Error'.

Return Value

This service returns a string object.

getLinkedObjectId

global Id getLinkedObjectId()

Gets the Id of the linked object.

Return Value

This service returns an Id object.

getLinkId

global virtual String getLinkId()

Return Value

The link ID of the target.

getLinkDeveloperName

global String getLinkDeveloperName()

Gets the developer name used to identify the link.

Return Value

This service returns a string object.

getDescription

global String getDescription()

Gets the description of the link.

Return Value

This service returns a string object.

getErrorBody

global fferpcore.ErpErrorBody getErrorBody()

Gets an error body containing the error messages concerning the link.

Return Value

This service returns an ErpErrorBody object.

© Copyright 2009–2019 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.