function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Metadata setObjectPermissions(...) not working


I have written a Java client that uses the metadata API in order to update the user profiles in an org.  I am able, for example, to change the tab visibility on the profiles.  However, when I try to change the object permissions for one of my custom objects on the user profile, using
ProfileObjectPermissions [] pers = new ProfileObjectPermissions[] { new ProfileObjectPermissions(Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, "MY_CUSTOM_OBJECT__C", Boolean.FALSE), ... };

When I update the metadata, no errors are returned, but the permissions on the user profile for the object remain unchanged.

Any idea what I am missing?



ShashankShashank (Salesforce Developers) 
You may find this helpful: