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
When deploying or releasing, in the "Executing Pre Deployer Picklist Enabler" phase we get an error :
Unable to process Picklist update due to Cannot read properties of undefined (reading 'Metadata')
From what I see in a debug session, it errors out when trying to process the "picklistInOrg" variable
TypeError: Cannot read properties of undefined (reading 'Metadata')
at PicklistEnabler.execute (@dxatscale/sfpowerscripts.core/lib/package/deploymentCustomizers/PicklistEnabler.js:84:55)
To Reproduce
Add a new picklist field to an object. package and deploy.
During the Picklist Enabler processing, the getPicklistInOrg() returns undefined for the picklistInOrg variable
When it evalues
if (!picklistInOrg && picklistInOrg?.Metadata?.valueSetc?.valueSetDefinition) continue;
if doesn't continue, then falls over here
for (const value of picklistInOrg.Metadata.valueSet.valueSetDefinition.value)
Expected behavior
New picklists shouldn't need to be deployed as the bug this is trying to solve for is for modified picklists ?
so if you don't get a value back from the target org, skip further processing. It would also be helpful to get more information out of the trace logging too as theres a lot that can go wrong
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] @dxatscale/sfpowerscripts/23.4.2 darwin-arm64 node-v20.5.1
Yes, I noticed the same during scratch org pool prepare (in an empty scratch org), while going through the logs. The deployment doesn’t stop/exit thought. It just says: Unable to process Picklist update due to Cannot read properties of undefined (reading 'Metadata') .
As you mention in the issue, it probably return undefined as this custom picklist doesn’t exist in an empty scratch org before the package is being installed.
Running locally I change the line
if (!picklistInOrg && picklistInOrg?.Metadata?.valueSetc?.valueSetDefinition) continue;
to
if (!picklistInOrg || picklistInOrg?.Metadata?.valueSetc?.valueSetDefinition) continue;
which seemed to work
Describe the bug
When deploying or releasing, in the "Executing Pre Deployer Picklist Enabler" phase we get an error :
Unable to process Picklist update due to Cannot read properties of undefined (reading 'Metadata')
From what I see in a debug session, it errors out when trying to process the "picklistInOrg" variable
TypeError: Cannot read properties of undefined (reading 'Metadata')
at PicklistEnabler.execute (@dxatscale/sfpowerscripts.core/lib/package/deploymentCustomizers/PicklistEnabler.js:84:55)
To Reproduce
Add a new picklist field to an object. package and deploy.
During the Picklist Enabler processing, the getPicklistInOrg() returns undefined for the picklistInOrg variable
When it evalues
if (!picklistInOrg && picklistInOrg?.Metadata?.valueSetc?.valueSetDefinition) continue;
if doesn't continue, then falls over here
for (const value of picklistInOrg.Metadata.valueSet.valueSetDefinition.value)
Expected behavior
New picklists shouldn't need to be deployed as the bug this is trying to solve for is for modified picklists ?
so if you don't get a value back from the target org, skip further processing. It would also be helpful to get more information out of the trace logging too as theres a lot that can go wrong
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: