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

Problem with ProfileTabVisibility for Standard Tabs using metadata API

Hi Guys,


I have a problem in setting ProfileTabVisibililty to standard tabs like "Accounts", "Leads".


Following code works fine with the custom tabs but not with standard tabs. Please help me as this is very urgent to me.


Profile p=new Profile();



ProfileTabVisibility ptv = new ProfileTabVisibility("__samp__c",TabVisibility.DefaultOn );

ProfileTabVisibility[] tabVisibilities = new ProfileTabVisibility[] {ptv};


UpdateMetadata updateMetadata = new UpdateMetadata(ProfileName, p);




AsyncResult[] ars= metadatabinding.update(new UpdateMetadata[] { updateMetadata });


This works fine.


But when I use standard tabs like "Account" it says


INVALID_CROSS_REFERENCE_KEY msg: In field: tab - no CustomTab named Account found



Anything that i set in ProfileTabVisibility is treated as CustomTab.


How can I set tab visibility for Standard Tab?


Quick reply would help me a lot.


Awaiting for your reply,



Anybody come across the solution to my problem????
Anzle TheThirdAnzle TheThird

This was asked a long long time ago but for anyone who stumbles across it, 
for profile tab visibility has the following structure for standard Objects: 

       'tab': 'standard-Account',
       'visibility': 'DefaultOn'

so I'd suggest trying to add the "standard-" infront of account when trying to do this.