Can I override the default query for the User or Group objects?
Answer:
When you include any lookup field to the User or Group objects (for example, OwnerId
), SFDMU will automatically add both User and Group objects to the job with a ReadOnly operation. SFDMU supports only reading records from these objects but does not allow updating or inserting them.
The default query for the User object included in the job is:
SELECT Id, Name FROM User
The default query for the Group object is:
SELECT Id, Name FROM Group WHERE Type = 'Queue'
You can override the default query for the User object by adding a dedicated section for the User object in export.json
, like this:
{
"query": "SELECT Id, Name FROM User WHERE Name <> 'User Name'",
"operation": "ReadOnly"
}
However, you cannot modify the query for the Group object, meaning the following is not allowed:
{
"query": "SELECT Id, Name FROM Group WHERE Type = 'Organization' AND Description <> null",
"operation": "ReadOnly"
}
The Group object is automatically included with default settings and cannot be modified.
Note: The externalId
field for both User and Group objects should always be the Name
field. This is set by default and can be omitted.