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

Invalid structure while fetching a recordtype which has a business process of the same name #714

Closed nickwick76 closed 2 years ago

nickwick76 commented 3 years ago

Summary

Note, this one is similar to issue #579 , which I also experience.

If you have a business process on Opportunity or Case and also have record types with the same name as the business process, then the record types end up in the business process folder when retrieving it with the CLI. This has been verified with VSCode, IntelliJ and CLI standalone. If you make a change to the record type in the IDE and deploy it, then it gets correctly deployed to the org. But if you make a change in the org and retrieve, the updated recordtype is the one in the business process folder.

Steps To Reproduce:

  1. Create a blank Trailhead org or use an existing org if possible
  2. Create an opportunity business process and a record type for that business process that share the same name
  3. Create a new project with the below example manifest (version doesn't seem to make a difference)
  4. Retrieve from org
  5. Check structure in the Opportunity objects and businessProcesses folder

Package.xml `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Opportunity CustomObject 50.0 ` ### Expected result There should only be business processes in the businessProcesses folder and recordtypes in the recordTypes folder ### Actual result There are record types and business processes in the businessProcesses folder and recordtypes in the recordTypes folder ### Additional information ![image](https://user-images.githubusercontent.com/6181405/97544511-01402000-19ca-11eb-875c-c948f2d77973.png) sfdx-cli/7.77.0-112dd7d412 darwin-x64 node-v12.18.3 @oclif/plugin-autocomplete 0.1.5 (core) @oclif/plugin-commands 1.3.0 (core) @oclif/plugin-help 3.2.0 (core) @oclif/plugin-not-found 1.2.4 (core) @oclif/plugin-plugins 1.9.1 (core) @oclif/plugin-update 1.3.10 (core) @oclif/plugin-warn-if-update-available 1.7.0 (core) @oclif/plugin-which 1.0.3 (core) @salesforce/sfdx-trust 3.4.3 (core) alias 1.1.2 (core) analytics 1.12.1 (core) auth 1.3.0 (core) config 1.1.9 (core) generator 1.1.3 (core) salesforcedx 50.2.0 (core) ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core) ├─ salesforce-alm 50.2.0 (core) ├─ custom-metadata 1.0.10 (core) ├─ templates 50.1.0 (core) └─ apex 0.1.1 (core) sfdx-cli 7.77.0 (core) macOS Catalina Version 10.15.7 (19H2)
github-actions[bot] commented 3 years ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

ghost commented 3 years ago

Just chiming in to say that I've experienced a similar issue. I'm working on a project where some objects have a list view and record type with the same developer name. sfdx force:source:retrieve puts the retrieved recordType-meta.xml file in the object's listViews directory.

git2gus[bot] commented 3 years ago

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

RensVerhagen commented 3 years ago

Seems the same issue as: #602

WillieRuemmele commented 3 years ago

Check out the new beta source commands which should fix this issue!

bfalter commented 3 years ago

@WillieRuemmele I am having this same issue; I am using the beta source commands as suggested: $ sfdx which force:source:retrieve === force:source:retrieve plugin: @salesforce/plugin-source I'm still getting my Opportunity RecordType metadata nested within BusinessProcesses. I am retrieving via package.xml

mshanemc commented 2 years ago

fixed for push in the upcoming version.