Salesforce allows you to describe sObjects either by using sObject or field tokens, or the describeSObjects Schema method.

learn more… | top users | synonyms

2
votes
1answer
29 views

Dynamic Schema getDescribe

I have two variables: public String selectedObject {get; set;} //selectlist public String selectedField {get; set;} //selectlist public String selectedDataType {get; set;} //text They are the ...
0
votes
0answers
48 views

Salesforce route “layouts/describe” returning {'body':null}

Given the headers and other information returned to our app, what would be causing body to be null(see below)? Our users are experiencing a sporadic error when calling the url below. We cannot figure ...
0
votes
1answer
33 views

Default value is null always,Schema.DescribeFieldResult [duplicate]

I am trying to describe a field and get the default value but the following always outputs null. Schema.DescribeFieldResult dfr = Account.SLASerialNumber__c.getDescribe(); system.debug('res ...
0
votes
0answers
25 views

Record Type Object Describe difference between detailLayoutSections and editLayoutSections

Looking at the describe back from Salesforce for an objects record type layout, there are two values returned within the object called; detailLayoutSections editLayoutSections Could anyone shed ...
1
vote
1answer
36 views

MiddleName Field cannot find in in “.fields.getMap()”

We've just enabled the Middle Name and Suffix Fields feature and encountered the below issue. SUMMERY : Just after enabling "Middle Name and Suffix Fields", Implementation of custom apex logic in a ...
2
votes
1answer
63 views

How to check if field is of formula type or not in dynamic apex? [duplicate]

public static void getFieldNames(String objName){ Map <String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe() .get(objName).getDescribe().fields.getMap(); ...
0
votes
0answers
21 views

Issue with Global Describe get vs containsKey when using namespace and Execute Anon vs Apex

Ok, so a different spin here to this: Issue with GlobalDescribe Field Results and Managed Package I do not think it should be doing this... When executing via the execute anonymous in dev console: ...
1
vote
1answer
14 views

Get sObject Gender via API

Is there any way I could get the Gender of a CustomObject? I thought it would be something like tcana__Tipo_Veiculo__c.getSObjectType().getDescribe().getGender() But it didn't work
5
votes
2answers
149 views

How to differentiate LIST apart from HIERARCHY setting in Apex?

My Apex code needs to dynamically reflect on user-defined Custom Settings. But the user could use a List or Hierarchy depending on their needs, so I need to be a bit careful manipulating each type. ...
0
votes
1answer
80 views

List Knowledge Articles on Visualforce Page

I am working on KnowledgeArticleVersion and want to show the list of articles on Visual force page. SObjectType objToken = Schema.getGlobalDescribe().get('KnowledgeArticleVersion'); ...
2
votes
0answers
24 views

Javascript, Forms, and Describe

One of the advantages of using Visualforce is the magic that happens when building forms. When you use an <apex:inputField> component (particularly when in an <apex:pageBlockSection>, ...
2
votes
1answer
42 views

Is it possible to determine the visibleLines() value of a multipicklist programmatically?

For a multipicklist, the visibleLines attribute value is not available from internal Schema.DescribeFieldResult.class. Is there any other way to determine what this value is for a field ...
3
votes
1answer
80 views

Describe call inconsistent in test class

In the Apex class below (executed in a client org), testA() passes while testB() fails. The failure is an assertion error from the ServiceLayer constructor. /* SF API 33 */ /* PKG version 1.55 */ ...
2
votes
3answers
93 views

How can I find out objectType of Account

I have the following code : Schema.SObjectType objectType = sObjects.get(0).getSObjectType(); I'm trying to write an IF statement to check if the result of objectType is specific object such as ...
4
votes
0answers
52 views

Get Plural Label in specific language

So I can do something like Id myId = '999999999999999'; String objectPluralLabel = myId.getSobjectType().getDescribe().getLabelPlural(); This returns the plural label of the object in the current ...
2
votes
1answer
90 views

How to check if an object has recordtypes specified or not?

I want to find a way how can I check if a type of object, has any record types specified or not. I tried, with the describe methods, by acquiring a List, according to the SObjectType, but this ...
2
votes
1answer
89 views

Get namespace prefix for a field

In a question I asked last week about getting namespaces, the best solution was to get information about the class (or any class) in the namespaced package. But this seems vulnerable if there are ...
4
votes
3answers
213 views

Apex Describe Field pulling unavailable field for SOQL

My describe call is pulling some of these fields (accountname,islocked,middlenamelocal,personkeyid,mayedit) on Contact object. There are few more.And my Dynamic SOQL is complaining that those ...
1
vote
0answers
17 views

Tracking changes to object structures through SOAP API

I am looking to check whether the object that I queried has changed during the previous access. For example, if a new field was added to the Account field, I would like to alert the user that a new ...
2
votes
1answer
30 views

What are ListViewChartInstances?

In v33.0, I see a new object, called ListViewChartInstance when describing all objects through SOAP API. However, in the Salesforce Spring '15 Release notes there's not a single word on them. Does ...
2
votes
1answer
46 views

Describe call returns fields that error in SOQL

The describe call is returning a bunch of fields on Account such as BillingLatitude, BillingLongitude, PhotoUrl, etc that result in the following error when included in SOQL queries: No such ...
1
vote
0answers
35 views

getDescribe() of an External Object throws NPE

I have a external object called "TD_Account__x" whose label is "TD Account". I am trying to do a describe call on "TD_Account__x" and it throws me NPE. Execute anonymous code - System.debug('@@ ...
8
votes
1answer
136 views

Name field of Group sObject is Not Nillable but returns null

I request the metadata for the sObject Group via: GET /services/data/v32.0/sobjects/Group/describe/ HTTP/1.1 In the resulting JSON i see the following metadata at the fields property: { ... ...
1
vote
1answer
68 views

Why Label of a field fetched via code gives a different value than what is displayed on Page Layouts?

I have tried fetching field Labels dynamically in my Visualforce page and apex class through Field Describe, but its been really annoying for me to fix this situation where field Labels are ...
5
votes
1answer
133 views

Standard field accessiblity inconsistent : feature or simply strange?

UPDATE: Thanks to @ca_peterson I could clarify the issue below and it all drills down to FLS. But even having identified FLS as the reason, the behavior is still odd and I have addressed it in this ...
8
votes
1answer
676 views

How to list down all Standard/Custom Objects and ignore System(Internal) Objects

There's always a requirement to pull ALL standard and custom objects using describe call ignoring all system/internal objects. Is there a way for same? One of option is to reference ProcessInstance ...
5
votes
2answers
222 views

What does object.isQueryable() actually mean?

What does is actually mean when a user can 'query' an Object? In other words: what rights does a user have when the Object.isQueryable() returns True? Pages like this only say that isQueryable ...
0
votes
1answer
167 views

How to minimize the view state of the custom visual force page.

How to minimize the view state of the custom visual force page. I have a custom VF page where I have a map that contains the list of sObject names. I need to make it available on the VF page to access ...
2
votes
1answer
30 views

getting layout of user using API

I am using this link to get the layout. I am using a REST client, Here is my request https://ap1.salesforce.com/services/data/v28.0/sobjects/Global/describe/layouts/ Authorization: Bearer ...
1
vote
3answers
4k views

Method does not exist or incorrect signature: [String].getDescribe()

I've checked the other answers and googled alot, cant seem to find the answer to why this doesnt work: public List<SelectOption> AccountIndustryOptions = new List<SelectOption>(); public ...
1
vote
0answers
36 views

Strange Field Describe Issue. Not showing existing fields. May be bug?

We have created an object last two months ago which contains 6 fields and they all are visible by describe call. Now we moved that object to another org with all dependencies etc. But there in ...
2
votes
1answer
263 views

$ObjectType and picklistValues attribute

I've tried to use {!$ObjectType.Case.fields.Status.picklistValues} but it doesn't work Error: Unsupported type common.api.soap.wsdl.PicklistEntry encountered. Based on the documentation I see ...
2
votes
1answer
291 views

Fields based on record type on visualforce page

Suppose I have two record types on a standard object, suppose Opportunity, and out of 100 fields in object, lets say for each record type 50-50 fields are made available to user to enter data on the ...
3
votes
2answers
2k views

How to perform a field describe dynamically using the API name of an sObject?

I am trying to get describe information about an sObject similar to this: public Map<String, Schema.SObjectField> fieldMap{get;set;} fieldMap=Schema.sObjectType.Lead.fields.getMap(); ...
0
votes
1answer
700 views

Calling .getDescribe() on result of SOQL query

If I have an SOQL query as follows, which returns only 1 field. String this_soql = 'SELECT SUM(My_Field__c) myField FROM My_Object__c WHERE Id=: the_Id GROUP BY Id'; SObject r = ...
6
votes
1answer
283 views

How to guard a FeedItem insert when code is executing in a Force.com Site?

I have some code that is used both through a normally licensed user and through a "Site Guest User" for a public Force.com Site. I am aware that for the latter type of User Chatter capabilities are ...
2
votes
0answers
110 views

Managed Package Upgrade fails due to sObject Describe failure

After adding some features to our managed package, our attempts to upgrade the package in a production org is failing with a generic error: Your requested install failed. Please try this again. ...
3
votes
1answer
591 views

Dynamic field retrieval from sobject in vf page

Map<String, Schema.SObjectField> M = Schema.SObjectType.Account.fields.getMap(); from this we can retrieve all the fields but of account object but i want retrieve all the fields of any ...
3
votes
2answers
329 views

Describe limits for objects with a lot of picklists from remoteTK

we are using remoteTK on a salesforce project and its working great except for one very specific issue. We are hitting governor limits with describes for one of the objects. IT has 150 picklists ...
3
votes
1answer
971 views

Compound Address fields and DescribeFieldResult

I have generic code in my org that retrieves all fields that are accessible by user public static String returnAllFields(String objectName){ String fieldsCSV = ''; for(Schema.SObjectField ...
14
votes
3answers
3k views

Is there anyway to get the name/label of a field without doing a field describe?

I want to get the name and label of all the fields for multiple sobjects in one transaction and that will easily hit the governor limits. Is there anyway I can get the label/name without using a ...
1
vote
0answers
169 views

Why would describe layouts endpoint return ENTITY_IS_DELETED error

I am working on a project that uses OAuth against SF via REST on behalf of users from a variety of organizations. For one of our users, I am able to call SObject describe on their Account object and ...
5
votes
1answer
232 views

DescribeSObjectResult contains fields of type reference with an unknown relationship name

I use the SOAP API (WSC, partner wsdl) to describe objects and use the field meta information to dynamically build SOQL queries. Today i observed that DescribeSObjectResult can contain fields of type ...
6
votes
2answers
173 views

Finding the SObjectType from the SObjectField

As part of the implementation of an API, I would like to be able to find the SObjectType from the SObjectField: public class MyClass { // Fields are from various SObjects public void ...
2
votes
1answer
156 views

Find out if field is of type Currency without consuming Describe's?

Parts of my code copy hundreds of arbitrary fields of an arbitrary object to another object. Before copying currency fields I want to do some fx conversion. How can I find out if a field is a ...
1
vote
2answers
576 views

How to get the Label of a Formula field dynamically

I'm trying to use Salesforce describe methods to get an object dynamically, and they get all the labels to that object. I am trying to use the following code, but the map being returned doesn't ...
8
votes
1answer
805 views

DescribeSObjectResult missing fields when executed in managed package

Problem Description Not being able to use both custom and managed fields in a managed package when fields share the same API name (with different namespaces). When using the ...
4
votes
1answer
409 views

How to get a list of all Quote sobjects using apex/soql

It appears that Quote is a SF SObject, yet the following code renders the following error: [SELECT Id From Quote] sObject type 'Quote' is not supported. If you are attempting to use a custom ...
3
votes
1answer
588 views

Getting false result when using Schema.SObjectField

I am using Schema.SobjectField to get all the fields of Account object. I am getting correct result in my development org. But when i add the class in a package and install it in another sf org, i am ...
5
votes
2answers
881 views

Test if a field is available on arbitrary SObject record without using Describe calls

I have many Custom Objects in my package that have a common custom field Version__c. One part of my app serializes and deserializes records to/from Json. While deserializing I want to change this ...