You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
Describe the bug
A followup bug to #1414
the picklist deployer fails when the picklist doesn't exist in the target org. It continues to attempt to read the child attributes even though it's undefined.
example log message :
Fetching picklist for custom field Sync_To__c on object Account
Unable to process Picklist update due to Cannot read properties of undefined (reading 'Metadata')
To Reproduce
add a new picklist to an object. Run a through validation job or deployment job if packaged.
Ensure the package definition doesn't include "enablePicklist": false (its enabled by default)
I think line 78 in packages/core/src/package/deploymentCustomizers/PicklistEnabler.ts is where the issue is
I believe the logic wants to be along the lines of picklistInOrg is null or the valueSetDefinition of the picklist is null then continue but this doesn't evaluate correctly as is. picklistInOrg is undefined when the picklst doesn't exist in target.
I made the following change locally which worked better for me. Happy to raise the PR
FROM
if (!picklistInOrg && picklistInOrg?.Metadata?.valueSet?.valueSetDefinition) continue;
TO
if (!picklistInOrg?.Metadata?.valueSet?.valueSetDefinition){
sfp_logger_1.default.log('picklist not in Org',sfp_logger_1.LoggerLevel.TRACE,logger);
continue;
}
Expected behavior
When it gets to processing the Picklists (PicklistEnabler) it will fail with a message like :
Unable to process Picklist update due to Cannot read properties of undefined (reading 'Metadata')
Screenshots
If applicable, add screenshots to help explain your problem.
Platform Details (please complete the following information):
OS: MacOS
Version [e.g. CLI Version eg: 1.6.6] SFP version 25.0.6
Salesforce CLI(sfdx cli) Version: SF version 2.7.11
CI Platform: GithubAction
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
A followup bug to #1414
the picklist deployer fails when the picklist doesn't exist in the target org. It continues to attempt to read the child attributes even though it's undefined.
example log message :
Fetching picklist for custom field Sync_To__c on object Account
Unable to process Picklist update due to Cannot read properties of undefined (reading 'Metadata')
To Reproduce
add a new picklist to an object. Run a through validation job or deployment job if packaged.
Ensure the package definition doesn't include "enablePicklist": false (its enabled by default)
I think line 78 in packages/core/src/package/deploymentCustomizers/PicklistEnabler.ts is where the issue is
I believe the logic wants to be along the lines of picklistInOrg is null or the valueSetDefinition of the picklist is null then continue but this doesn't evaluate correctly as is. picklistInOrg is undefined when the picklst doesn't exist in target.
I made the following change locally which worked better for me. Happy to raise the PR
FROM
if (!picklistInOrg && picklistInOrg?.Metadata?.valueSet?.valueSetDefinition) continue;
TO
if (!picklistInOrg?.Metadata?.valueSet?.valueSetDefinition){
sfp_logger_1.default.log('picklist not in Org',sfp_logger_1.LoggerLevel.TRACE,logger);
continue;
}
Expected behavior
When it gets to processing the Picklists (PicklistEnabler) it will fail with a message like :
Unable to process Picklist update due to Cannot read properties of undefined (reading 'Metadata')
Screenshots
If applicable, add screenshots to help explain your problem.
Platform Details (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: