Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Commit 65e36ee

Browse files
fix(picklist): Cannot read properties of undefined (reading 'Metadata')
* issues/1441 : Bug fix for picklist Deployment fixes the Cannot read properties of undefined (reading 'Metadata') included some trace logging for troubleshooting * fix: remove comment --------- Co-authored-by: Azlam <[email protected]>
1 parent 300fde5 commit 65e36ee

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/core/src/package/deploymentCustomizers/PicklistEnabler.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,15 @@ export default class PicklistEnabler implements DeploymentCustomizer {
7474

7575
let picklistInOrg = await this.getPicklistInOrg(urlId, sfpOrg.getConnection());
7676

77-
//check for empty picklists on org and fix first deployment issue
78-
if (!picklistInOrg && picklistInOrg?.Metadata?.valueSet?.valueSetDefinition) continue;
77+
if (!picklistInOrg?.Metadata?.valueSet?.valueSetDefinition)
78+
SFPLogger.log(
79+
`Picklist field ${objName}.${picklistName} not in target Org. Skipping`,
80+
LoggerLevel.TRACE,
81+
logger
82+
);
83+
continue;
84+
}
85+
7986

8087
let picklistValueInOrg = [];
8188

@@ -115,6 +122,7 @@ export default class PicklistEnabler implements DeploymentCustomizer {
115122
}
116123
} catch (error) {
117124
SFPLogger.log(`Unable to process Picklist update due to ${error.message}`, LoggerLevel.WARN, logger);
125+
SFPLogger.log(`Error Details : ${error.stack}`, LoggerLevel.TRACE);
118126
}
119127
}
120128

0 commit comments

Comments
 (0)