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
Dima YelizarovDima Yelizarov 

Cannot unset “Default” radio button for custom application using Metadata API

We have a Java utility that uses Metadata API to remove “Default” radio button for our custom application for System Administrator profile, so we can remove this custom application later. Here is a piece of the code that we use:

 

            Profile profile = new Profile();

 

            // System Administrator profile

            profile.setFullName(“Admin”);

 

            ProfileApplicationVisibility appVisibility = new ProfileApplicationVisibility();

            appVisibility.setApplication(“Our custom application”);

            appVisibility.setDefault(false);

            profile.getApplicationVisibilities().add(appVisibility);

 

            UpdateMetadata updateMetadata = new UpdateMetadata();

            updateMetadata.setMetadata(profile);

            metadataConnection.update(Collections.singletonList(updateMetadata));

           

This worked fine for a long period of time, but recently it stopped working (I suspect after org update to the version #25). After that when we run this util the “visibility” checkbox is unchecked for our custom app, but it remains default. I tried different ways to make this working, including setting default SalesForce apps (i.e. Sales for Site.com) as default or using other appVisibility’s methods, but had no luck. Do someone knows whether I miss something or some other ways how default radio button can be unset?

 

Thanks in advance!

atormanatorman

@Dima - Prior to v25 of the MdAPI -  since every profile has to have one and only one default app (tabset), if you were removing your custom app as the default app for the System Admin profile, what became the default app for this profile? 

atormanatorman

BTW, have you filed a case with support so that we can investigate it more completely? If not, please do. Thanks!