HomeGuidesDeveloper HubRelease Notes
Get supportBook a chat
Developer Hub
These docs are for v2.60. Click to read the latest docs for v2.208.

FieloPLT.AgreementService Class

FieloPLT.AgreementService class includes one method.

Obtain Agreement (getCurrentAgreement)

static FieloPLT__Agreement__c FieloPLT.AgreementService.getCurrentAgreement (Id programId, Set<String> fieldNames)

It allows you to obtain the current Agreement which is part of a specific Program.

Parameters

ParameterTypeDescription
programIdIdID of the Program the Agreement is part of.
fieldNamesSet<String>API names from Agreement fields to query.

Return Value

TypeDescription
FieloPLT__Agreement__cCurrent Agreement from the specific Program.

Exceptions

TypeDescription
FieloCustomExceptionWhen there is either no Agreement available or the Agreement has Draft status.
Id programId = [SELECT Id FROM FieloPLT__Program__c LIMIT 1].Id;

Set<String> fields = new Set<String>{'Id', 'FieloPLT__Status__c', 'FieloPLT__Agreement__c'};

FieloPLT__Agreement__c agreement = FieloPLT.AgreementService.getCurrentAgreement(programId, fields);