Closed Raptor399 closed 2 years ago
:tada: This issue has been resolved in version 2.8.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@Raptor399 Thanks for you report!
I wasn't aware of the StandardValueSet ForecastCategoryName
and so there was no mapping entry yet.
I've now added one in the latest release.
Please note that you'll have to provide statusCategory
(instead of value
):
{
"metadataType": "StandardValueSet",
"metadataFullName": "ForecastCategoryName",
"newValue": "Most Likely",
"statusCategory": "Most Likely",
"active": true
}
P.S.: Unfortunately it's difficult to keep track of available StandardValueSets.
If you know some other resource/API to list all available StandardValueSets, please let me know.
I'm only aware of https://developer.salesforce.com/docs/atlas.en-us.234.0.api_meta.meta/api_meta/standardvalueset_names.htm where ForecastCategoryName
is not listed.
Thank you for the update and the correction, @amtrack !
I'm getting an error when trying to apply the modified project-scratch-browserforce.json
to a new test org, though? This is what I get:
$ sfdx plugins
sfdx-browserforce-plugin 2.8.0
$ sfdx browserforce:apply -f config/project-scratch-browserforce.json --targetusername scratch
logging in... done
Applying definition file config/project-scratch-browserforce.json to org test-cmuq29hktfni@example.com
[Security] retrieving state... done
[Security] no action necessary
[Picklists] retrieving state... done
[Picklists] changing 'picklistValues' to '[{"metadataType":"StandardValueSet","metadataFullName":"ForecastCategoryName","newValue":"Most Likely","statusCategory":"Most Likely","active":true}]'... failed
ERROR running browserforce:apply: waiting for XPath `//tr[td[2][text() = "undefined"]]//td[1]//a[contains(@href, "/setup/ui/picklist_masteractivate.jsp")]` failed: timeout 30000ms exceeded
logging out... done
@Raptor399 OK, I'm able to reproduce this. Will look into it.
@Raptor399 Sorry for the wrong config I provided last time! The active
property should be omitted.
When adding a new picklist palue, it is set active by default. So there is no need to provide the active
property.
The code actually interprets a given active
property as instruction to enable/disable an existing picklist value.
I've tried the following config, and it seems to work now:
config/project-scratch-browserforce.json
:
{
"$schema": "https://raw.githubusercontent.com/amtrack/sfdx-browserforce-plugin/master/src/plugins/schema.json",
"settings": {
"security": {
"loginAccessPolicies": {
"administratorsCanLogInAsAnyUser": true
}
},
"picklists": {
"picklistValues": [
{
"metadataType": "StandardValueSet",
"metadataFullName": "ForecastCategoryName",
"newValue": "Most Likely",
"statusCategory": "Most Likely"
}
]
}
}
}
$ sfdx browserforce:apply -f config/project-scratch-browserforce.json
logging in... done
Applying definition file config/project-scratch-browserforce.json to org test-3akzhbwfgno5@example.com
[Security] retrieving state... done
[Security] no action necessary
[Picklists] retrieving state... done
[Picklists] changing 'picklistValues' to '[{"metadataType":"StandardValueSet","metadataFullName":"ForecastCategoryName","statusCategory":"Most Likely","newValue":"Most Likely"}]'... done
logging out... done
$ sfdx browserforce:apply -f config/project-scratch-browserforce.json
logging in... done
Applying definition file config/project-scratch-browserforce.json to org test-3akzhbwfgno5@example.com
[Security] retrieving state... done
[Security] changing 'loginAccessPolicies' to '{"administratorsCanLogInAsAnyUser":true}'... done
[Picklists] retrieving state... done
[Picklists] no action necessary
logging out... done
Excellent! Can confirm this works on my end as well. Thank you for investigating!
I am trying to add a picklist value and get the following error message:
I don't understand which "url" argument the error message is talking about, or what I can do to prevent the problem.
To reproduce, use the following files:
sfdx-project.json
config/project-scratch-def.json
config/project-scratch-browserforce.json
With these files, run the following commands:
Notice how the security action seems to run fine, whereas the picklist action doesn't.