I am trying to create some test data with snowfakery. I am creating users with the snowfakery recipe below.
I am creating 1 user, then another user as a 'friend' so I can set the manager field on the second user with the first user.
The problem is I am getting an 'Invalid assignee' error on the Insert PermissionSetAssignment
step
[12/08/21 18:17:58] Beginning task: LoadData
As user: [email protected]
In org: 00D2F000000K3vQ
[12/08/21 18:18:15] Running step: Insert PermissionSetAssignment
[12/08/21 18:18:16] Prepared 2 rows for DataOperationType.INSERT to PermissionSetAssignment.
Error: Error on record with id 1: INVALID_CROSS_REFERENCE_KEY: Invalid assignee ID: {0}. ()
Is there something wrong with the recipe?
I've tried using nicknames but that does not seem to help.
- plugin: snowfakery.standard_plugins.Salesforce
- plugin: snowfakery.standard_plugins.Salesforce.SalesforceQuery
- macro: userdata
fields:
Alias:
fake: alias
FirstName:
fake: firstname
LastName:
fake: lastname
Username: ${{firstname}}${{random_number(1000, 100000)}}@${{random_number(1000, 10000)}}fake.claritycx1.com
Email: ${{Username}}
TimeZoneSidKey: America/Bogota
LocaleSidKey: en_US
EmailEncodingKey: UTF-8
LanguageLocaleKey: en_US
ProfileId:
Salesforce.ProfileId: Standard User
- object: User
nickname: manager
include: userdata
friends:
- object: PermissionSetAssignment
fields:
AssigneeId:
reference: User
PermissionSetId:
SalesforceQuery.find_record:
from: PermissionSet
where: Name='KAM_Manager'
- object: User
include: userdata
fields:
ManagerId:
reference: manager
friends:
- object: PermissionSetAssignment
fields:
AssigneeId:
reference: User
PermissionSetId:
SalesforceQuery.find_record:
from: PermissionSet
where: Name='KAM'