2

I'm using Cumulus CI to push our metadata changes to our production Salesforce app using cci flow run dev_org --org production and this generally works fine.

I have a custom object called Print_Job__c that has a single list view called "All" in my project code. In production, the Print_Job__c object also has the "All" list view as well as other custom list views using filters like "Mine".

Whenever I run the cci flow run dev_org command, it deletes all of the list views from the custom object in production other than the "All" list meaning I have to recreate them.

How can I prevent cci from deleting other list views for the object?

Can I somehow no longer include the Print_Job__c list views as part of the project so they're managed entirely in production. Currently if I remove the listView folder from the object it results in the error message [Failed]: Update of ListView Print_Job__c.All: Error: cannot delete last filter Exception in task deploy_unmanaged.uninstall_packaged_incremental

Thanks

1 Answer 1

3

I am on the CumulusCI team at Salesforce.org.

I really do not recommend using the dev_org flow to deploy to production. That's not what that flow is intended to do, and it may have unintended consequences. In particular, the dev_org flow includes:

  • update_admin_profile, which attempts to give the System Administrator profile access to all custom and some standard schema.
  • uninstall_packaged_incremental, which removes elements previously deployed in your package that are not present in your source tree. This may or may not be desirable in a production org depending on your source control model and change management strategy.

The latter is what is impacting you here. Because List Views are part of the Custom Object (which is being deployed by CumulusCI), the uninstall_packaged_incremental task believes you intend to delete them - since they're not in your source tree.

There are three solutions possible:

  1. Extract the List Views from your production org and commit them to version control.

  2. Instruct uninstall_packaged_incremental to ignore them by adding customization in cumulusci.yml:

    tasks:
        uninstall_packaged_incremental:
            options:
                ignore_types:
                    - RecordType # Included by default
                    - ListView
    
  3. Stop using dev_org to deploy to production, since that is not its intended purpose. Instead, consider building your own flow that includes only the specific operations that you need - for example, you'd want to copy the configuration of deploy from dev_org.

1
  • 1
    Thanks for a great answer David. 1) Isn't an option due a known issue with the metadata api where scope:Mine is invalid (trailblazer.salesforce.com/issues_view?id=a1p30000000T5YqAAK). 2) I'll try this first. 3) Definitely will have a go at this - my main hesitancy until now in creating a deploy flow is not fully understanding the full implications of each task (we use NPSP), in particular the two you've mentioned - update_admin_profile and uninstall_packaged_incremental so thanks for the info.
    – Dan
    Commented Aug 2, 2021 at 8:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .