Skip to content

Commit

Permalink
Fix show all data issue #430 when clicking menu item on subfield (add…
Browse files Browse the repository at this point in the history
…ress)
  • Loading branch information
tprouvot committed May 16, 2024
1 parent cda5788 commit e5c5f97
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions addon/setup-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e5c5f97

Please sign in to comment.