amtrack / sfdx-browserforce-plugin

sfdx plugin for browser automation
MIT License
109 stars 38 forks source link

Add/Update picklist values #432

Closed aly76 closed 3 years ago

aly76 commented 3 years ago

UPDATE 12/5/21

The picklist plugin currently supports deletion, activation/deactivation and 'find and replace'. It would be useful to be able to add and update picklist values, as there have been cases where the Metadata API fails to add/update values (e.g. ContractStatus) and the only workaround is browser automation or manual intervention.


We're trying to replace picklist values in the ContractStatus standard value set, but keep getting "no action necessary" as an output. Is there something we are missing?

Plugin version: 2.5.6 SFDX CLI: 7.99.0 salesforcedx: 51.0.0 Chromium: 91.0.4469.0 (Developer Build) (x86_64)

To replicate:

$ sfdx browserforce:apply -f definition-file.json -u scratchorg
logging in... done
Applying definition file definition-file.json to org scratchorg
[Picklists] retrieving state... done
[Picklists] no action necessary
logging out... done
# definition-file.json
{
    "$schema": "https://raw.githubusercontent.com/amtrack/sfdx-browserforce-plugin/master/src/plugins/schema.json",
    "settings": {
      "picklists": {
        "picklistValues": [
          {
            "metadataType": "StandardValueSet",
            "metadataFullName": "ContractStatus",
            "value": "In Approval Process",
            "newValue": "Pre Creation"
          },
          {
            "metadataType": "StandardValueSet",
            "metadataFullName": "ContractStatus",
            "value": "Draft",
            "newValue": "Queued"
          },
          {
            "metadataType": "StandardValueSet",
            "metadataFullName": "ContractStatus",
            "value": "Activated",
            "absent": false
          }
        ]
      }
    }
}

l

aly76 commented 3 years ago

After a bit more experimentation, looks like what the plugin supports is "Find and Replace", whereas we're after "New" or "Edit" functionality for picklist values.

amtrack commented 3 years ago

@aly76 I assume there are some benefits for choosing browser automation over Metadata API for adding/updating Picklist Values.

Would you mind sharing them?

azlam-abdulsalam commented 3 years ago

We ran into a specific scenario, for ContractStatus on a scratch org, Updating values using metadata api result in an Integrity error

azlam-abdulsalam commented 3 years ago

This is what we are testing out, hope its in the right direction. https://github.com/dxatscale/sfdx-browserforce-plugin/pull/1

amtrack commented 3 years ago

@azlam-abdulsalam That's good to know. Thanks for the feedback!

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 2.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: