Skip to main content

#Sfdx Command0 人がディスカッション中

Using sdfx pull command to pull a PersonAccount Matching Rule from a scratch org is having some issues. The pulled file (Account.matchingRule) is almost empty. Please find the content of the file below. As you can notice, the file doesn't have any meta information about my custom matching rule that I created in my scratch org. Any ideas? Is this an SFDX bug?

<?xml version="1.0" encoding="UTF-8" ?>

<MatchingRules xmlns="http://soap.sforce.com/2006/04/metadata" />

#SFDX CLI #Sfdx Command #Person Account #Matching Rule #Sfdx #SFDX Source

5 件の回答
  1. 2024年4月1日 3:54

    For anyone who comes here for a solution: To include PersonAccount Matching rule, you have to use PersonAccount.<MatchingRuleName>

    <types>

    <members>PersonAccount.Custom_Person_Account_Matching_Rule</members>

    <name>MatchingRule</name>

    </types>

    <types>

    <members>PersonAccount</members>

    <name>MatchingRules</name>

    </types>

0/9000

Hi Everyone,

 

I updated my sf cli to the latest - 2.28.6 and I am gettig the following error when running from the command line.

Error (10): Metadata API request failed: Cannot read properties of null (reading 'split')

 

OS : OSX 14.3.1

Node: darwin-arm64 node-v21.6.1

Cli: @salesforce/cli/2.28.6

 

I tried downgrading the cli.

- I completely uninstalled the sf cli and reinstalled the following versions 2.26.10 & 2.24.4 versions.  

- I ran a simple: sf project deploy start and got the same Error (10) Metadata API request failed: Cannot read properties of null (reading 'split')

 

#Salesforce Developer  #SFDX CLI  #SFDX  #Sfdx Command

4 件の回答
0/9000

Dear fellow trailblazers,

 

I recently came across a simple request to retrieve admin profile to my repo from an org that contains the right object permission I would like to deploy elsewhere.

 

After running the following cli command:

sfdx force:source:retrieve -m Profile:Admin -u abc

 

The profile is retrieved but only has userPermissions, everything else are missing including objectPermissions.

 

I did a quick online research, everything's pointing to updating package.xml, which I don't have it in my project repo, for example:

<?xml version="1.0" encoding="UTF-8"?>

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

<types>

<members>Account.MyCustomField__c</members>

<name>CustomField</name>

</types>

<types>

<members>*</members>

<name>Profile</name>

</types>

<version>53.0</version>

</Package>

Since my company repo doesn't have package.xml so no point going down this direction.

 

Could anyone help me understand what is missing here?

 

Thank  you in advance!

 

Cheers

Dale

 

#SFDX CLI #Profile Permissions #Profiles #Salesforce DX #Salesforce Developer #Sfdx #Sfdx Command

6 件の回答
  1. 2024年1月24日 11:00

    This might be very late to answer. However, adding my comment in case if someone needs this. 

     

    If you don't have a package.xml, alternatively you can use below command where you can specify the components that you want to retrieve.

     

    sfdx force:source:retrieve -m "Profile,CustomObject"

    Note that in the last parameter of this command, we specify the metadata components. In your case @Dale Wang you need to specify "CustomObject" along with "Profile" as already answered by @Kishan Kumar. If you do not specify "CustomObject", for all the profiles retrieved only "UserPermissions" will be fetched.

     

    However, note that whenever we retrieve profiles using this approach or by using package.xml, the SFDX command does not retrieve all the permissions. Only the permissions where access is explicitly given will be fetched. E.g. for a profile, if object permission - Read is given for object CustomObject1__c and no permission is given on CustomObject2__c, even if you specify both objects in the package.xml or the command parameters, it will retrieve object permissions for CustomObject1__c only as it finds the <allowRead> attribute as TRUE in Salesforce.

0/9000

Dear Fellow Trailblazers,

 

For some reason I lost my auth'ed connection to my scratch org in vs code this morning.

 

When I try auth again this morning using the following command:

sfdx force:auth:web:login -r https://test.salesforce.com -a abc

or even this command:

sfdx auth:web:login -r https://test.salesforce.com -a abc

 

I keep getting the following error after I entered the credential

 

Cannot auth my scratch org any more

And in vs code it reads

 

issue-with-auth-vs-code.JPG

 

I did some googling, it seems I might need to update sfdx. But I've had problems before with updating sfdx that breaks everything else, so I wasn't sure if I can trust that solution.

 

Could someone help me what the issue is?

 

Much appreciated

 

Cheers

Dale

 

#SFDX CLI #Sfdx #Salesforce DX #Sfdx Command #Salesforce Developer #Salesforce Developers

3 件の回答
0/9000
Shivam N が「#SFDX CLI」で質問

The force:org:list command displays username for the orgs that have been authorized and the active scratch orgs that have been created. I don't have any active scratch orgs, but in the non-scratch org list, it shows a (U) letter on the left of one of the org username. According to the developer doc, U points to the default scratch org username, but I don't have one and instead it should have been (D) which points to the default dev hub org username for that org username. Why U is there for a non-scratch org? The org which has a U on the left is a developer edition org that I've authorized.

Thanks!

 

#Visual Studio #SFDX CLI #Scratch Orgs #Salesforce Developer

2 件の回答
0/9000

I'm trying to use sfdx:force:source:convert to convert page layouts from source format to metadata format, and realise there seems to be some bug with the command.

 

Repro:

  1. Specify few page layouts from both standard object and custom object in my manifest (package.xml)
  2. Run sfdx:force:source:convert, specifying my output directory and path to manifest
  3. Check the outcome in the output directory

As shown in my attached screenshot, my package.xml (Labeled 1) consists of 2 page layouts from custom objects and 2 page layouts from standard object (Case & Contact)

 

In my original source folder (Labeled 2), I have many other page layouts from those objects

 

In my output directory (Labeled 3), all the custom objects' page layouts got converted even though they are not specified in the package.xml, but for standard objects' page layouts, only those specified in package.xml get converted.

 

Is this a bug from the sfdx command, or is it an expected behaviour?

Appreciate if anyone who knows about this can help. Thank you.

 

#Sfdx Command #SFDX CLI #Page Layout

 

Problem using force:source:convert on custom object's page layout

6 件の回答
  1. 2021年7月15日 10:42

    Hi @Yean Chiat Wong

     

    I had exactly the same issue with the layouts. From time to time, similar bugs appear, that the CLI team fixes, then bugs appear again, the team fixes them, and so on.

    Very similar to what you have now:

    https://github.com/forcedotcom/cli/issues/156

     

    Fortunately, there is a tool that can help. This is SFDX Essentials:

    https://www.npmjs.com/package/sfdx-essentials

    https://github.com/nvuillam/sfdx-essentials

     

    After sfdx:source:convert you can use sfdx-essentials:

    sfdx essentials:metadata:filter-from-packagexml -i path/to/convertedMd -p path/to/package.xml

     

    Mark the answer is the best one if it helps.

0/9000

Dear DX Team, 

We have written a java program and using sfdx command we are retrieving all the metadata from the org.

 

The program is failing with out of memory exception.

 

Is there any way to check how much memory is taking (memory available vs memory occupied )when sfdx force:mdapi:retrieve command is running ? (we have 8GB of memory allocated to the java application already)

 

Appreciate your input on this issue, thanks.

1 件のコメント
0/9000