You need to sign in to do that
Don't have an account?
Kumbresh K
How to enable the record types for the automated user profile through apex code?
We have implemented a platform event trigger (gives additional governor limit and executes synchronously) in our product to overcome the SOQL 101 limit issue. As we know that, the platform events executed as an automated user.
In this implementation, we are updating a custom object as well as setting up the record types. Currently, to enable the record types for the automated user profile we are doing URL hacking using the system Administrator profile manually. This is the workaround we found in the development forum. Please refer below.
https://salesforce.stackexchange.com/questions/210710/automated-process-user-profile-permissions
https://goravseth.com/giving-automated-process-user-access-to-apex-class
The problem is, we have around 50+ clients and this is a pretty complicated config and needs to do in all 50+ clients on every release or package upgrade.
Can it be done with the script if yes what is the solution?
In this implementation, we are updating a custom object as well as setting up the record types. Currently, to enable the record types for the automated user profile we are doing URL hacking using the system Administrator profile manually. This is the workaround we found in the development forum. Please refer below.
https://salesforce.stackexchange.com/questions/210710/automated-process-user-profile-permissions
https://goravseth.com/giving-automated-process-user-access-to-apex-class
The problem is, we have around 50+ clients and this is a pretty complicated config and needs to do in all 50+ clients on every release or package upgrade.
Can it be done with the script if yes what is the solution?
As per this documentation
sObjects That Do Not Support DML Operations in Apex
AccountTerritoryAssignmentRule
AccountTerritoryAssignmentRuleItem
ApexComponent
ApexPage
BusinessHours
BusinessProcess
CategoryNode
CurrencyType
DatedConversionRate
NetworkMember (allows update only)
ProcessInstance
Profile
RecordType
SelfServiceUser
StaticResource
Territory2
UserAccountTeamMember
UserPreference
UserTerritory
WebLink
Let me know if it helps
I don't want to create a record type in Apex. I want to enable the record type permission on profile level for Automated User
I got the solution and in a recent release Salesforce has given option to "Configure the User and Batch Size for Your Platform Event Trigger" and this solved my problem
For reference:
https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_trigger_config.htm
https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_platformeventsubscriberconfig.htm
Thanks,
Kumbresh