• LeoLi
  • NEWBIE
  • 15 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 11
    Replies
We needs to use Schema and DesscribeSObjectResult classes to get all SObject in the user's organization. But we noticed performance problem after upgraded to API v44.
The following code could reproduce the issue:
Visualforce Page Code:
<apex:page controller="TestSchemaTimeController">
    <script type="text/javascript">
        function perform() {
            var args = [];
            var start = new Date().valueOf();
            args.push("{!$RemoteAction.TestSchemaTimeController.QuerySchema}");
            args.push(function(result, event) { var output = document.getElementById("output"); output.value += "Count:" + result + " Time:" + (new Date().valueOf() - start) + "ms\r\n"; });
            args.push({ buffer: false, escape: false, timeout: 120000 }); 
            window.Visualforce.remoting.Manager.invokeAction.apply(window.Visualforce.remoting.Manager, args);
        }
        function clearOutput() {
            var output = document.getElementById("output");
            output.value = "";
        }
    </script>
    <h1>Test Schema Time</h1>
    <div>
        <button onclick="perform()">Click</button>
        <button onclick="clearOutput()">Clear</button>
    </div>
    <div>
        <TextArea id="output" style="width:800px;height:600px"></TextArea>
    </div>
</apex:page>
Apex Code 
public class TestSchemaTimeController {
    @RemoteAction
    public static Integer QuerySchema() {
        Map<String, Schema.SObjectType> typeMap = Schema.getGlobalDescribe();
        for (Schema.SObjectType sot : typeMap.values()) {
            System.debug(sot);
            Schema.DescribeSObjectResult dsr = sot.getDescribe();
            //String name = dsr.getName();
            //Boolean acc = dsr.isAccessible();
        }
        return typeMap.values().size();
    }
}
By the demo code above, it cost about 250~300ms via API version 43, but cost about 1000~1600ms via API version 44. You could modify the API version of the Apex Class to verify the result.
API v45 preview in sandbox also have the performance issue.
We have no idea why this Apex method is slow down after API version 44. And we have to keep on using API version 43 now to make sure our customer not face the performane issue.
Anyone else meet the same problem?
  • January 28, 2019
  • Like
  • 0
There was a new critical update named "Remove Instance Names From URLs for Visualforce, Community Builder, Site.com Studio, and Content Files". But after active it, all of the Tabs which contains a Visualforce Page could not be shown on one/one.app when display with the Safari browser on the iPhone.

To make sure this issue was not caused by any other reason, I created the following simple Visualforce Page
<apex:page >
    <apex:outputPanel id="output">Test Page</apex:outputPanel>
</apex:page>
And I also make it be "Available for Lightning Experience, Lightning Communities, and the mobile app"
Then I create a new Tab and also I add it in the Salesforce Navigation in Mobile Administration.

When I deactive that critical update, I can see the text "Test Page" when I click my sample Tab. But unfortunately, it shows nothing after I active that option.

Why? Anybody else meets the same probelm with me?

It looks like that Claibome mets a similar issue, but I think there is a little difference: https://developer.salesforce.com/forums?id=9060G0000005TW2QAM

BTW, I also noticed that when the problem occurs, there were several errors reported in the console, several 404 errors and also a strange "Failed to load resource: too many HTTP redirect" error.
  • February 22, 2018
  • Like
  • 0
I'm writing code to deploy and remove my sample package with Metadata API File-Based Calls. The code can works well but I still meet a problem:
Because of I specifiy the fullName in the package.xml file, after the code deployed, there will be a new Package created in the package list.
But after I removed the all of the source code with destructiveChanges.xml file, I noticed that the empty package still be there.

I tried to use other Metadata APIs to enumerate the created package list, but I always fails. Then I checked with the describeMetadata() API, I noticed that only InstalledPackage exists, no metadata type called Package in my DE.

But I still eager to know how could I remove the created package by code? Any one meets the same problem as me?
  • November 26, 2015
  • Like
  • 0
There was a new critical update named "Remove Instance Names From URLs for Visualforce, Community Builder, Site.com Studio, and Content Files". But after active it, all of the Tabs which contains a Visualforce Page could not be shown on one/one.app when display with the Safari browser on the iPhone.

To make sure this issue was not caused by any other reason, I created the following simple Visualforce Page
<apex:page >
    <apex:outputPanel id="output">Test Page</apex:outputPanel>
</apex:page>
And I also make it be "Available for Lightning Experience, Lightning Communities, and the mobile app"
Then I create a new Tab and also I add it in the Salesforce Navigation in Mobile Administration.

When I deactive that critical update, I can see the text "Test Page" when I click my sample Tab. But unfortunately, it shows nothing after I active that option.

Why? Anybody else meets the same probelm with me?

It looks like that Claibome mets a similar issue, but I think there is a little difference: https://developer.salesforce.com/forums?id=9060G0000005TW2QAM

BTW, I also noticed that when the problem occurs, there were several errors reported in the console, several 404 errors and also a strange "Failed to load resource: too many HTTP redirect" error.
  • February 22, 2018
  • Like
  • 0
There is a new critical update called Remove Instance Names From URLs for Visualforce, Community Builder, Site.com Studio, and Content Files.

DANGER! DANGER! DO NOT ACTIVATE!

This changes links for visualforce pages.  <domain name>.visualforce.com replaces <domain name>.<instancename>.visual.force.com.

For whatever reason, this does not work with Visualforce tabs or with buttons that link to visualforce pages.

With the critical update deactivated, the link for visualforce tab is https://<domain name>.<instancename>.visual.force.com/apex/TimeEntryCalendar?sfdc.tabName=01r500000003bNn.

When the critical update is activated, the link for the visualforce tab is https://<domain name>.visualforce.com/apex/TimeEntryCalendar?sfdc.tabName=01r500000003bNn.

The problem is that clicking the "activated" link yields this:
 
This site can’t be reached
<domain name>.visualforce.com’s server IP address could not be found.

In my case, it was a really big problem because the visualforce tab was the default home page. So activating the Critical Update essentially locked all of my users out of salesforce.com. 

This also fails with a simple button link to a visual force page.

If you assign a url to a button or type the link in - /apex/TimeEntryCalendar for instance, it works fine when the update is deactivated.

But activate the update, and it fails on just the simple link.

Problem exists in both Classic and Lightning.

MAJOR SNAFU!
I'm writing code to deploy and remove my sample package with Metadata API File-Based Calls. The code can works well but I still meet a problem:
Because of I specifiy the fullName in the package.xml file, after the code deployed, there will be a new Package created in the package list.
But after I removed the all of the source code with destructiveChanges.xml file, I noticed that the empty package still be there.

I tried to use other Metadata APIs to enumerate the created package list, but I always fails. Then I checked with the describeMetadata() API, I noticed that only InstalledPackage exists, no metadata type called Package in my DE.

But I still eager to know how could I remove the created package by code? Any one meets the same problem as me?
  • November 26, 2015
  • Like
  • 0