From e5c5f97d43ed4e6f4a540384773fdd26a5cca0d2 Mon Sep 17 00:00:00 2001 From: Thomas Prouvot Date: Thu, 16 May 2024 11:02:50 +0200 Subject: [PATCH] Fix show all data issue #430 when clicking menu item on subfield (address) --- addon/setup-links.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/addon/setup-links.js b/addon/setup-links.js index ef1bac29..e72f80ef 100644 --- a/addon/setup-links.js +++ b/addon/setup-links.js @@ -13,17 +13,19 @@ export async function getObjectSetupLinks(sfHost, sobjectName) { } function getFieldDefinitionSetupLinks(sfHost, fieldName, fieldDefinition, isCustomSetting, isCustomMetadata) { - let durableId = fieldDefinition.DurableId.split("."); - let entityDurableId = durableId[0]; - let fieldDurableId = durableId[durableId.length - 1]; - let customType = isCustomMetadata ? "CustomMetadata" : isCustomSetting ? "CustomSettings" : ""; - let lightSetupLink = isCustomMetadata ? `https://${sfHost}/lightning/setup/${customType}/page?address=%2F${fieldDurableId}%3Fsetupid%3D${customType}` : `https://${sfHost}/lightning/setup/ObjectManager/${entityDurableId}/FieldsAndRelationships/${fieldDurableId}/view`; - return { - lightningSetupLink: lightSetupLink, - classicSetupLink: fieldName.includes("__") - ? `https://${sfHost}/${fieldDurableId}` - : `https://${sfHost}/p/setup/field/StandardFieldAttributes/d?id=${fieldDurableId}&type=${entityDurableId}` - }; + if(fieldDefinition?.DurableId){ + let durableId = fieldDefinition.DurableId?.split("."); + let entityDurableId = durableId[0]; + let fieldDurableId = durableId[durableId.length - 1]; + let customType = isCustomMetadata ? "CustomMetadata" : isCustomSetting ? "CustomSettings" : ""; + let lightSetupLink = isCustomMetadata ? `https://${sfHost}/lightning/setup/${customType}/page?address=%2F${fieldDurableId}%3Fsetupid%3D${customType}` : `https://${sfHost}/lightning/setup/ObjectManager/${entityDurableId}/FieldsAndRelationships/${fieldDurableId}/view`; + return { + lightningSetupLink: lightSetupLink, + classicSetupLink: fieldName.includes("__") + ? `https://${sfHost}/${fieldDurableId}` + : `https://${sfHost}/p/setup/field/StandardFieldAttributes/d?id=${fieldDurableId}&type=${entityDurableId}` + }; + } } export async function getFieldSetupLinks(sfHost, sobjectName, fieldName, isCustomSetting) {