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
rwc0001rwc0001 

Metadata API - ENTITY_IS_DELETED when trying to change Tab Visibility

I'm able to create a new object tab through the metadata api, but I'm not having much luck updating the tab visibility.

 

When I try to update the tab visibility I'm getting an 'ENTITY_IS_DELETED' message.

 

The code looks good based on this post, but maybe I'm mising something?

 

ProfileTabVisibility tabVisibility = new ProfileTabVisibility(); tabVisibility.setTab(objectName); tabVisibility.setVisibility(TabVisibility.DefaultOn); String profileName = "Admin"; Profile userProfile = new Profile(); userProfile.setFullName(profileName); userProfile.setTabVisibilities(new ProfileTabVisibility[] { tabVisibility }); UpdateMetadata updateMetadata = new UpdateMetadata(); updateMetadata.setMetadata(userProfile); updateMetadata.setCurrentName(profileName); ars = metadataConnection.update(UpdateMetadata[] { updateMetadata });

 

Debugging snapshot of the updateMetadata array

 

[[UpdateMetadata currentName='Admin' metadata='[Profile [Metadata fullName='Admin' ] applicationVisibilities='{[0]}' classAccesses='{[0]}' fieldLevelSecurities='{[0]}' layoutAssignments='{[0]}' objectPermissions='{[0]}' pageAccesses='{[0]}' recordTypeVisibilities='{[0]}' tabVisibilities='{[1][ProfileTabVisibility tab='last_try__c' visibility='DefaultOn' ] ,}' ] ' ] ]

 Debuggig snapshot of status check

 

[[AsyncResult checkOnly='false' done='true' id='04s30000000HcHkAAK' message='entity is deleted' numberComponentErrors='0' numberComponentsDeployed='0' numberComponentsTotal='0' numberTestErrors='0' numberTestsCompleted='0' numberTestsTotal='0' secondsToWait='0' state='Error' stateDetail='null' stateDetailLastModifiedDate='null' statusCode='ENTITY_IS_DELETED' ] ]

 

 

 

 

 

 

 

rwc0001rwc0001
I've tried this on multiple profiles with the same result.