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

learn more… | top users | synonyms

0
votes
1answer
41 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
14 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
32 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
44 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
62 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 ...
3
votes
0answers
25 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
47 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
29 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
115 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
14 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
24 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
29 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
31 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
96 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
46 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
77 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 ...
0
votes
0answers
63 views

Using NoteAndAttachemnt via SOAP API/SOQL queries

I'm building a SalesForce case management front-end in C#, using a SoapClient built from our company's Enterprise WSDL. I've hit a sticking point in retrieving the upload date for case attachments. ...
7
votes
2answers
419 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 ...
0
votes
0answers
60 views

Rollup summary field: Describe precision

I have a rollup summary field field1 that calculate a SUM of a number field childfield (in a detail object and having 1 as length) Is that normal that when i describe field1 i get the value 1 in ...
5
votes
2answers
170 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
111 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
29 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
3k 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
34 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
192 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
222 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
986 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
345 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
219 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
99 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
518 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 ...
2
votes
2answers
260 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
712 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 ...
13
votes
3answers
2k 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
143 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 ...
4
votes
1answer
205 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 ...
3
votes
2answers
122 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
131 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
469 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
653 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
332 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
446 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 ...
2
votes
2answers
537 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 ...
12
votes
1answer
2k views

Getting “__r” relationship name from Schema.SObjectType.Fields

Say I have a master-detail relationship between two objects, Schematic__c and Part__c. I can SOQL query the master from the detail: [SELECT Schematic__r.Name FROM Part__c] If I'm building a query ...
2
votes
1answer
395 views

Tab Style Icon from sObjectType

Is it possible to get the tab style from the sObjectType? In other words, if I have an object with a tab icon of "People", the tab style I'd want to return is "Custom15"... Any ideas?
11
votes
4answers
13k views

Apex: Dynamically get fields for an SObject - no hardcoding

It states in Salesforce Apex docs that I can get fields for a particular SObject (standard or custom) in the following way: Map<String, Schema.SObjectField> M = ...
6
votes
1answer
457 views

How to get a visualforce tab url in apex code

I have a requirement where when I click on a link need to to direct to a visualforce tab. So how to get the VF tab url dynamically using apex code. Thanks in adavance.
5
votes
1answer
458 views

Update Record via @RestResource class, return related SObject

I'm trying to create a REST API class that will allow the following: POST Object ID Update(ObjId); ('Touching' the record, fires triggers on Salesforce) Find SObjects on a custom object that have ...
22
votes
1answer
696 views

New Schema.describeSObjects not working as expected

There is a new method for Schema in Winter 14 called Schema.describeSObjects. The idea as I understand the docs is that you can pass in a list of sObject names as strings, and get back the describe ...
7
votes
2answers
3k views

Generic SObject update pattern

Question I know that it is possible to update a generic of List<SObject>, But what is the best approach to generate that list without knowing the SObjectType, only the ids ? Sample: ...