GetPriceAgreementItems()

Fetches price agreement items for a specified price agreement type.

API Details

Parameters

Name

Type

Description

request

CPQApiStruct.GetPriceAgreementItemsRequestDO

     The request data object.

Request Data Object - CPQApiStruct.GetPriceAgreementItemsRequestDO

Field

Type

Required?

Description

PriceAgreementType

String

Yes

The type of price agreement. Valid Values: Proposal, Agreement.

Criteria

CPQApiStruct.FilterDo

No

The criteria details like API agreement name and proposal. This is based on FilterDo object.

fieldNames

List<String>

No

The list of fields to be displayed in the response data object based on the price agreement type.

priceAgreementNumbers

List<String>

No 

The list of price agreements numbers.


CPQApiStruct.FilterDO

This is an API object that feeds to criteria variable of below request objects:

  • CPQApiStruct.GetPriceAgreementsRequestDO
  • GetPriceAgreements CPQApiStruct.GetPriceAgreementItemsRequestDO

Request Data Object - CPQApiStruct.FilterDO

Field

Type

Required?

Description

SObjectName

String

Y

API name of the subject valid values are: Apttus_Proposal__Proposal__c, Apttus__APTS_Agreement__c

Predicates

List<CPQApiStruct.PredicateDO>

Y

 List of conditions in where clause

ConditionExpr

String

N

To define the complex logic among multiple conditions.

Example for 2 conditions (1 OR 2)


CPQApiStruct.PredicateDO

This API defines a filter based on which criteria specifications are set. List of this needs to feed Predicates variable of FilterDO object type variable.

Parameters

Name

Type

Description

request

CPQApiStruct. PredicateDO

     The request data object.

Request Data Object - CPQApiStruct.PredicateDO

Field

Type

Required?

Description

RowNum

Integer

Y

The row numbers.

FieldName

String

Y

The API name of the field.

CompOper

String

Y

The type of query comparator. Valid values:

equal to,

not equal to,

less than,

less than or equal to,

greater than,

greater than or equal to,

in,

not in,

like,

not like,

includes,

excludes,

starts with,

ends with,

contains,

does not contain.

FieldValue

String

Y

The value based on which data should be fetched.

API Response

Response Data Object - CPQApiStruct.GetPriceAgreementItemsResponseDO

Field

Type

Description

PriceAgreementItems

List<sObject>

The list of price agreement items fetched based on the specified input fields.

Code Sample

Apttus_Config2.CPQApiStruct.GetPriceAgreementItemsRequestDO  request = new Apttus_Config2.CPQApiStruct.GetPriceAgreementItemsRequestDO ();
// possible values Proposal,Agreement
request.PriceAgreementType = 'Proposal';

Apttus_Config2.CPQApiStruct.FilterDO criteriaSpec = new Apttus_Config2.CPQApiStruct.FilterDO();
// sobject name

criteriaSpec.SObjectName = 'Apttus_Proposal__Proposal_Line_Item__c';
// setup predicates
Apttus_Config2.CPQApiStruct.PredicateDO predicate = new Apttus_Config2.CPQApiStruct.PredicateDO();
predicate.RowNum = 1;
predicate.FieldName = 'Apttus_Proposal__Proposal__r.Apttus_Proposal__Approval_Stage__c';
predicate.CompOper = 'equal to';
predicate.FieldValue = 'Accepted';

Apttus_Config2.CPQApiStruct.PredicateDO predicate2 = new Apttus_Config2.CPQApiStruct.PredicateDO();
predicate2.RowNum = 1;
predicate2.FieldName = 'Apttus_Proposal__Proposal__r.Apttus_Proposal__ExpectedStartDate__c';
predicate2.CompOper = '=';
predicate2.FieldValue = ':Apttus_QPConfig__StartDate__c'; 

criteriaSpec.Predicates.add(predicate2);

criteriaSpec.ConditionExpr = '1 AND 2';

List<String> fieldNames = new List<String>{'Id','Name'};
request.Fields.addAll(fieldNames);

List<String> priceAgreementNumbers = new List<String>();
priceAgreementNumbers.add('Q-00002175');

// contract numbers
request.PriceAgreementNumbers.addAll(priceAgreementNumbers);
 	        


Apttus_CPQApi.PriceAgreementApiCallback apiCall = new Apttus_CPQApi.PriceAgreementApiCallback();
Apttus_Config2.CPQApiStruct.GetPriceAgreementItemsResponseDO  result = apiCall.getPriceAgreementItems(request);
system.debug(result.PriceAgreementItems);
CODE