New answers tagged

0

listMetadata() would give you all the profiles, including their Id and full name values. retrieveMetadata() only accepts fullName, however, but you can choose to use * to retrieve all profiles at once. However, it is generally ill-advised to name a custom profile the same name as a standard one because of the reason you've discovered. You can't specify a ...


4

If it is subject to use the Metadata API only, I don't see a method to accept an ID instead of the fullName. However, if you are able to also use the REST API, the URL to retrieve data of a particular profile by ID is (API version can be changed): /services/data/v49.0/sobjects/Profile/{ID} If you need to find the ID of all profiles, the URL is: /services/...


1

I have half of the answer here using SSJS <script runat="server"> Platform.Load("core","1"); var filters = { Property:'ActiveFlag', SimpleOperator: 'equals', Value: 'true' }; var cols = ["ID", "Name", "Email", "ActiveFlag", "...


0

I ended up just creating a formula field on my Sample object rather than using the LWC controller to look to the user.


0

It took some digging, but I was able to solve this issue. The LC buttons were converted JavaScript buttons from Salesforce classic. That conversion process generates some LC helper classes during the conversion process. Apparently the process added the helper classes to the System Administrator profile automatically. Once I added the helper classes to the ...


1

As of the Spring '20 release, you can set a flow version to always run in system context, bypassing the limited object/field permissions of the running user. (Assuming you're not depending on user permissions to hide/show different fields to different users, etc...) Steps: Open the flow in Flow Builder. Click View properties. Click Show Advanced. For How ...


4

Having all/most unit tests runAs users is usually overkill in most organizations. Permission requirements frequently change as roles, profiles, and permission sets are added and updated, so having lots of tests that rely on this may result in needing to deploy code changes to apply security permissions. This can quickly become unmanageable. I've always ...


0

If I have understood your query properly then give proper CRED and other required permissions under that profile.


0

To add the object access for profile. Setup >> User >> Profile >> System Administrator (Any profile) >> Standard Object Permissions >> Lead (select) >> Read


0

I just ran into a very similar issue with Opportunity and a custom object that had a Master-Detail relationship back to Opportunity. I was attempting to insert an ObjectPermissions record against Opportunity for a particular ParentId PermissionSet and got the following error: Id permissionSetId = //... Some existing Permission Set gets looked up. // Note ...


1

You can't get the Flow to execute as another User. You can make it run in system context in terms of Permissions and Level of access to Fields and Records, but you can't make it "impersonate" a User. If you don't mind a "not very nice" solution, you could condition your Flow on a specific field change, and then do the field change using a ...


Top 50 recent answers are included