What is the purpose of Schema.getModuleDescribe() method?

On developer console, Schema class autocomplete menu has listing of getModuleDescribe method, but could not find any documentation for same.

When executed throwing following exception:

System.SecurityException: Your organization does not have permission
to access this describe method.

Signatures

<String,Schema.SObjectType> Schema.getModuleDescribe()
<String,Schema.SObjectType> Schema.getModuleDescribe(String moduleName)

Answer

Items like this usually indicate pilot features being tested. Things leak out through the APIs that some orgs are testing, but aren’t yet available broadly. Hence the SecurityException.

That it isn’t in the official Schema documentation yet supports this. Features in pilots often change before final release, so Salesforce don’t want you building anything based on them.

Poking around in the Chrome Developer tools, I spotted the following call:

https://na5.salesforce.com/services/data/v36.0/tooling/completions?type=apex&_=1459904648219

This is the standard Tooling API completions resource.

In the response JSON:

      {
        "argTypes": [ ],
        "isStatic": true,
        "name": "getModuleDescribe",
        "parameters": [ ],
        "references": [ ],
        "returnType": "Map<String,Schema.SObjectType>"
      },
      {
        "argTypes": [ "String" ],
        "isStatic": true,
        "name": "getModuleDescribe",
        "parameters": [
          {
            "name": "moduleName",
            "type": "String"
          }
        ],
        "references": [ ],
        "returnType": "Map<String,Schema.SObjectType>"
      }

If this is indeed part of a pilot you will need to see if Salesforce would respond. Anyone who would be on the pilot has likely signed an NDA so won’t be able to help publicly.

Attribution
Source : Link , Question Author : Swapnil Shrikhande , Answer Author : Daniel Ballinger

Leave a Comment