From 7092b1d663ccb67e22a0bc9ed6c6fe6c379eaf92 Mon Sep 17 00:00:00 2001 From: salesforce-suyash-more Date: Fri, 19 Jul 2024 22:30:40 +0530 Subject: [PATCH] Changes in ALLO_ManageAllocations_CTRL.cls for FLS checking Before checking access, fields in the GAU Allocations fieldset are checked for formula field type and permissionability. --- .../main/default/classes/ALLO_ManageAllocations_CTRL.cls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/force-app/main/default/classes/ALLO_ManageAllocations_CTRL.cls b/force-app/main/default/classes/ALLO_ManageAllocations_CTRL.cls index c02f2eb4cd3..d8d41d0bb2c 100644 --- a/force-app/main/default/classes/ALLO_ManageAllocations_CTRL.cls +++ b/force-app/main/default/classes/ALLO_ManageAllocations_CTRL.cls @@ -93,6 +93,10 @@ public with sharing class ALLO_ManageAllocations_CTRL { objectFields.add(Allocation__c.General_Accounting_Unit__c.getDescribe().getSobjectField()); for(Schema.FieldSetMember additionalField : additionalAllocationFields) { + Schema.DescribeFieldResult fieldResult = additionalField.getSObjectField().getDescribe(); + if (fieldResult.isCalculated() || !fieldResult.permissionable || additionalField.getFieldPath().contains('__r')) { + continue; + } objectFields.add(additionalField.getSObjectField()); }