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
| Parameter | Type | Description |
|---|---|---|
| programId | Id | ID of the Program the Agreement is part of. |
| fieldNames | Set<String> | API names from Agreement fields to query. |
Return Value
| Type | Description |
|---|---|
| FieloPLT__Agreement__c | Current Agreement from the specific Program. |
Exceptions
| Type | Description |
|---|---|
| FieloCustomException | When 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);