Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG-FEATURE] - Query User , but query Group ... #677

Closed
unizhu opened this issue Dec 28, 2023 · 8 comments
Closed

[BUG-FEATURE] - Query User , but query Group ... #677

unizhu opened this issue Dec 28, 2023 · 8 comments
Assignees
Labels
bug Something isn't working, looks like a bug completed The issue was successfully resolved/Feature is completed feature-request New feature request or a change in the existing functionality

Comments

@unizhu
Copy link

unizhu commented Dec 28, 2023

Describe the bug
The latest sf cli and sfdmu plugin to migrate data related to OwnerId

To Reproduce

Expected behavior
A clear and concise description of what you expected to happen.

export.json

{
    "objects": [],
    "objectSets": [
        {
            "objects": [
                {
                    "query": "SELECT Id,  OwnerId, XXX FROM CAR__c",
                    "operation": "Upsert",
                    "externalId": "Name"
                },
                {
                    "query": "SELECT Id  FROM User Where UserType = 'Standard'",
                    "operation": "Readonly",
                    "externalId": "Alias"
                }
            ]
        }
    ],
    "alwaysUseRestApiToUpdateRecords": true,
    "promptOnIssuesInCSVFiles": true,
    "createTargetCSVFiles": true
}

Log file

=== Getting and analysing object metadata ...
[10:46:25.28] Fetching metadata of the CAR__c (Source) ...
[10:46:25.628] Fetching metadata of the CAR__c (Target) ...
[10:46:26.64] Fetching metadata of the User (Source) ...
[10:46:29.542] Fetching metadata of the User (Target) ...
[10:46:32.874] Fetching metadata of the Group (Source) ...
=== Preparing data migration job ...
[10:46:33.187] Building the migration strategy ...
Order of objects to query: User; CAR__c
Order of objects to delete: CAR__c; User
Order of objects to update: User; CAR__c
[10:46:33.190] Preparing of the data migration job has been completed.
=== ANALYSING DATA...
[10:46:33.369] {User} The original query string of this object is returning 623 records from the Source org.
[10:46:33.526] {User} The original query string of this object is returning 715 records from the Target org.
[10:46:33.679] {CAR__c} The original query string of this object is returning 2 records from the Source org.
[10:46:33.868] {CAR__c} The original query string of this object is returning 2 records from the Target org.
=== Triggering Add-On events ...
[10:46:33.871] No Add-On modules found to run.
[10:46:33.872] Ready to process the data.
=== Deleting old data from the Target ...
[10:46:33.873] {CAR_Type_Code__c} No records to delete.
[10:46:33.874] {User} No records to delete.
=== Source:
=== Fetching the data (STAGE 1) ...
[10:46:33.878] {User} Fetching the Source data from Org (STAGE 1: all records) ...
Command in progress... done

[10:46:43.892] [ERROR] Error during execution of the command:
Group WHERE (Type = 'Queue') AND (UserType = 'Standard')
^
ERROR at Row:1:Column:50
No such column 'UserType' on entity 'Group'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names..
[10:46:43.899] [ERROR] Execution of the command sfdmu:run has been completed. Exit code 4 (COMMAND_EXECUTION_ERROR).
[10:46:43.900] Total time elapsed: 00h 00m 32s 240ms .

_target.csv file.
When you have an issue with failed rows, attach the dump of the _target.csv file containing the error messages (at least 1-2 relevant full rows).

@unizhu unizhu added the bug Something isn't working, looks like a bug label Dec 28, 2023
Copy link

github-actions bot commented Jan 1, 2024

This case has been marked as 'to-be-closed', since it has no activity for the 3 days.
It will be automatically closed in another 3 days of inactivity.

@github-actions github-actions bot added the to-be-closed The issue is about to be closed label Jan 1, 2024
@hknokh2
Copy link
Contributor

hknokh2 commented Jan 1, 2024

Hello,

Thank you for getting in touch, and my apologies for the delayed response. In SFDMU, both user and group records are handled using the same query. It's important to keep this in mind for the plugin's normal functionality when crafting a query for the user object.

Cheers.

@github-actions github-actions bot removed the to-be-closed The issue is about to be closed label Jan 2, 2024
@unizhu unizhu closed this as completed Jan 2, 2024
@unizhu
Copy link
Author

unizhu commented Jan 22, 2024

But I need to query sepecify users instead of all 20K + users... it take much more time to fetch all users..

@unizhu unizhu reopened this Jan 22, 2024
Copy link

This case has been marked as 'to-be-closed', since it has no activity for the 3 days.
It will be automatically closed in another 3 days of inactivity.

@github-actions github-actions bot added the to-be-closed The issue is about to be closed label Jan 26, 2024
Copy link

This case has been closed, since it has no activity for the last 6 days. Feel free to reopen it, if you need more help.

@hknokh
Copy link
Collaborator

hknokh commented Feb 17, 2024

Hello,

I apologize for the inconvenience caused by the accidental closure of the issue. I understand your use case and have identified a solution that will enable you to query the User object independently from the Group object. Consequently, I am reopening this issue to continue addressing it.

Best regards.

@hknokh hknokh reopened this Feb 17, 2024
@hknokh hknokh added feature-request New feature request or a change in the existing functionality in-progress Issue is currently in the resolution progress and removed bug Something isn't working, looks like a bug to-be-closed The issue is about to be closed labels Feb 17, 2024
@hknokh hknokh changed the title [BUG] - Query User , but query Group ... [FEATURE-REQUEST] - Query User , but query Group ... Feb 17, 2024
@hknokh hknokh closed this as completed in 3f7fbed Mar 12, 2024
hknokh pushed a commit that referenced this issue Mar 12, 2024
@hknokh2
Copy link
Contributor

hknokh2 commented Mar 12, 2024

Hello,

The issue regarding the custom query for the User object has been resolved. You can now set a dedicated query string for the User object, as detailed in our documentation: Handling Record OwnerId.

Please ensure that the ExternalId you use is also supported by the Group object, as described in the documentation. Be aware that the 'Alias' field is not supported; therefore, it might still pose a problem. Consider replacing it with 'Name' or another unique field supported by both objects.

Regards,

@hknokh hknokh added bug Something isn't working, looks like a bug completed The issue was successfully resolved/Feature is completed and removed feature-request New feature request or a change in the existing functionality in-progress Issue is currently in the resolution progress labels Mar 12, 2024
@hknokh hknokh changed the title [FEATURE-REQUEST] - Query User , but query Group ... [BUG] - Query User , but query Group ... Mar 12, 2024
@hknokh hknokh reopened this Mar 12, 2024
@hknokh hknokh added the feature-request New feature request or a change in the existing functionality label Mar 12, 2024
@hknokh hknokh changed the title [BUG] - Query User , but query Group ... [BUG-FEATURE] - Query User , but query Group ... Mar 12, 2024
@hknokh
Copy link
Collaborator

hknokh commented Mar 13, 2024

Hello.

I hope the issue has been resolved for you. I'm closing it for now. Please let me know if you have any further questions.

Regards.

@hknokh hknokh closed this as completed Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, looks like a bug completed The issue was successfully resolved/Feature is completed feature-request New feature request or a change in the existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants