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

Commit

Permalink
issues/1441 : Bug fix for picklist Deployment
Browse files Browse the repository at this point in the history
fixes the Cannot read properties of undefined (reading 'Metadata')
included some trace logging for troubleshooting
  • Loading branch information
cjbradshaw committed Nov 23, 2023
1 parent 4ff16d8 commit 16d400c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@ export default class PicklistEnabler implements DeploymentCustomizer {
let picklistInOrg = await this.getPicklistInOrg(urlId, sfpOrg.getConnection());

//check for empty picklists on org and fix first deployment issue
if (!picklistInOrg && picklistInOrg?.Metadata?.valueSetc?.valueSetDefinition) continue;
//if (!picklistInOrg || picklistInOrg?.Metadata?.valueSetc?.valueSetDefinition) continue;
if (!picklistInOrg?.Metadata?.valueSet?.valueSetDefinition)
SFPLogger.log(
`Picklist field ${objName}.${picklistName} not in target Org. Skipping`,
LoggerLevel.TRACE,
logger
);
continue;
}

let picklistValueInOrg = [];

Expand Down Expand Up @@ -112,6 +120,7 @@ export default class PicklistEnabler implements DeploymentCustomizer {
}
} catch (error) {
SFPLogger.log(`Unable to process Picklist update due to ${error.message}`, LoggerLevel.WARN, logger);
SFPLogger.log(`Error Details : ${error.stack}`, LoggerLevel.TRACE);
}
}

Expand Down

0 comments on commit 16d400c

Please sign in to comment.