• Dima Yelizarov
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

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!