From 0c9e4e786116b00a66730755e3fd88c9d6ee209b Mon Sep 17 00:00:00 2001 From: Keenan Langston Date: Wed, 19 Mar 2025 11:36:03 -0500 Subject: [PATCH] add special case for KnowledgeArticleVersion in FindRecordsInCollection --- .../main/default/classes/FindRecordsInCollection.cls | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flow_action_components/CollectionProcessors/force-app/main/default/classes/FindRecordsInCollection.cls b/flow_action_components/CollectionProcessors/force-app/main/default/classes/FindRecordsInCollection.cls index 5c9980b09..3e8b36e54 100644 --- a/flow_action_components/CollectionProcessors/force-app/main/default/classes/FindRecordsInCollection.cls +++ b/flow_action_components/CollectionProcessors/force-app/main/default/classes/FindRecordsInCollection.cls @@ -52,7 +52,14 @@ global with sharing class FindRecordsInCollection { global static Schema.SobjectField getFieldByName(String objectName, String fieldName) { // get the SObjectType - Schema.SObjectType objectType = Schema.getGlobalDescribe().get(objectName); + Schema.SObjectType objectType; + if(objectName == 'KnowledgeArticleVersion'){ + // KnowledgeArticleVersion is a special case, it needs to be handled differently + objectType = KnowledgeArticleVersion.getSObjectType(); + } + else{ + objectType = Schema.getGlobalDescribe().get(objectName); + } // get the fields on the object Map fieldMap = objectType.getDescribe().fields.getMap();