+ 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: https://github.com/palominolabs/sf-api-connector/blob/master/soap-api-connector/src/main/java/com/palominolabs/crm/sf/soap/ProfileObjectPermissions.java