forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
486 stars 78 forks source link

Source pull confusing record types and list views #656

Closed scott-arcus closed 2 years ago

scott-arcus commented 3 years ago

Summary

Giving a list view the same name as a record type causes the pull command to place the list view metadata files into the record types folder in the source project structure. It is also the case that if you delete the list view from the Salesforce org then pull it will delete the record type metadata file locally.

Steps To Reproduce:

  1. Create a record type named Test for the Account sObject.
  2. Pull the source to get the record type file locally.
  3. Create a list view named Test for the Account sObject.
  4. Again pull the source.

Expected result

Local source should contain 1 record type metadata file in the record types folder and 1 list view metadata file in the list views folder.

Actual result

Local source contains 1 record type metadata file in the record types folder and 1 list view metadata file in the record types folder.

Additional information

SFDX CLI Version(to find the version of the CLI engine run sfdx --version): sfdx-cli/7.75.0-5521f40d11 win32-x64 node-v12.18.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

sfdx-cli/7.75.0-5521f40d11 win32-x64 node-v12.18.3
arcus-shared> sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-mobile 0.3.0
@salesforce/lwc-dev-server 2.5.1
├─ @oclif/plugin-help 2.2.3
└─ @oclif/plugin-update 1.3.10
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforcedx 49.13.0 (core)
├─ templates 49.9.1 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ custom-metadata 1.0.10 (core)
├─ apex 0.1.0 (core)
└─ salesforce-alm 49.12.1 (core)
sfdx-cli 7.75.0 (core)

OS and version:

Microsoft Windows 10 Pro
10.0.18362 Build 18362
axefan commented 3 years ago

I had a similar issue. Had a list view and record type on a custom object with the same developer name.

After retrieve, the record type meta file ended up in the listViews folder.

I fixed the issue by renaming the list view on the server, moving the record type meta file to the recordTypes folder, retrieving the sobject, then deleting the list view with the old name from local.

mshanemc commented 3 years ago

W-8395553

uip-robot-zz commented 3 years ago

This issue has been linked to a new work item: W-9299447