salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

Cannot deploy namespaced Apex classes in unlocked packages to org

Open Banuson opened this issue 1 month ago • 10 comments

Hello,

I want to update a class from an unlocked packaged installed in my org with namespace MyPackage.

I am able to retrieve it, but if I want to change anything (adding a comment for example) in that file I am not able to deploy. I want to deploy using metadata API. The apex class file is : classes/MyPackage__myClass.cls with MyPackage namespace. public class myClass { // class content } But when I try to deploy I have this error message: File name mismatch with class name: myClass

Another issue is that in Org Browser: files shows with doubled namespace for example: MyPackage__MyPackage__myClass.cls Retrieve using the org browser throws this error: Entity of type 'ApexClass' named 'MyPackage__MyPackage__myClass' cannot be found

Currently I can only edit the class from Dev Console or Setup>Apex Class.

Salesforce Extension Version in VS Code: v60.15.0 Salesforce CLI Version: @salesforce/cli/2.42.6 win32-x64 node-v20.12.2 OS and version: Microsoft Windows 11 Enterprise 10.0.22621 Build 22621 VS Code version: Version: 1.90.0 Most recent version of the extensions where this was working: N/A

Banuson avatar Jun 12 '24 08:06 Banuson