TransWikia.com

SFDX Source retrieve duplicating classes

Salesforce Asked by vrr on February 13, 2021

I have a custom structure inside main/defaut/classes

enter image description here

The classes where created in these custom folders. When i try to retrieve metadata with:

sfdx force:source:retrieve --sourcepath ...force-appmaindefaultclasses

The existing classes are not updated, but created again in the root directory force-appmaindefaultclasses

One Answer

This is a bug and you can try the alm pre version by using below for a temporary fix

sfdx plugins:install salesforce-alm@mpd

Look for updates to the CLI in the coming days.

Also make sure to follow below guidelines

Source path in your command has to be the exact path as your class name.

Try this

sfdx force:source:retrieve --sourcepath force-appmaindefaultclassesApplicationControllerContactsController

The other would be not using the path and use the name like below

sfdx force:source:retrieve -m "ApexClass:ContactsController"

Correct answer by Mohith Shrivastava on February 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP