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

learn more… | top users | synonyms

1
vote
3answers
34 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
16 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
22 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
22 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 ...
2
votes
2answers
49 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
28 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 = ...
0
votes
0answers
18 views

How to retrieve the SoftphoneLayout configuration within an Apex Class?

I'm trying to retrieve the SoftphoneLayout configuration within my apex class. I've tried several methods but couldn't find a way to access the record and it's content. 1) SQL/SOQL Query: SELECT Id ...
6
votes
1answer
73 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
38 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
105 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 ...
1
vote
1answer
57 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
100 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 ...
11
votes
3answers
274 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
71 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
103 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 ...
2
votes
2answers
73 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
58 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
126 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 ...
5
votes
1answer
203 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
135 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 ...
2
votes
1answer
175 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
117 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 ...
9
votes
1answer
772 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
137 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?
6
votes
3answers
3k views

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
275 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
211 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
307 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 ...
6
votes
2answers
840 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: ...
4
votes
2answers
1k views

System.LimitException: Too many describes: 101.?

I am getting this error as i have used getdescribe under for loop.Can some tell me how should i solve this..how to create map for this .please help. Thanks Map<String, ...
2
votes
1answer
170 views

How we can find that particular object has “Notes and Attachments” related list in it

I need to find that if selected sObject has included "Notes and Attachment". Is it possible through sObject Describe? I need to filter all sObject in organisation by availability of "Notes and ...
3
votes
2answers
525 views

How to tell whether a field is required or not in Apex by describe fields

I want to know how I tell whether a field is required or not in an Apex controller. In my controller I get the record id and then get the object of that record by a describe call, then I get all the ...
1
vote
2answers
259 views

ActionSupport rerender causes insufficient privileges error

I'm trying to create a dependent picklist of objects and fields. I present a list of objects to the user, and depending on the object they select, I show the object's String fields in the second ...
0
votes
1answer
795 views

DescribeSObjectResult.Fields contains fields that do not appear to exist?

I am using the force.com SOAP API (Partner WSDL) to query one of our Salesforce orgs and retrieve a list of all objects and all fields of each object. This seemed pretty simple as I could quite ...
4
votes
1answer
222 views

Error when I populate lookup with external id using .put method

You can populate lookup fields using an object with an external id field populated like so: Custom_Object__c o = new Custom_Object__c(Account__r=new Account(External_ID__c='123')); insert o; ...
4
votes
2answers
2k views

Access to State and Country Picklist values through Apex or API?

I recognize that State and Country Picklists are still a "Beta" feature, but does anyone know if, in Summer 13, its possible to get at the State and Country Picklist Values through either the Apex ...
4
votes
0answers
147 views

Why is KnowledgeArticleVersion not in Schema.getGlobalDescribe()?

It's a bit inconvenient that this returns null: system.debug( Schema.getGlobalDescribe().get('KnowledgeArticleVersion') ); While this does not: system.debug( ...
6
votes
1answer
161 views

Is there a Class.forName() equivalent for Apex

I'm looking to dynamically instantiate a class by its name. How can I do that in Apex? I thought about a factory method with a series of if-else statements, but am not satisfied with that as it isn't ...
11
votes
1answer
502 views

Does anybody have a good way of mapping a key prefix to an object type?

I want to be able to reliably take an ID and map it to the appropriate object type so I can query the object in question. Before now I've tried using the global decsribe info, looping over the ...
0
votes
1answer
296 views

How to get fields in deeper object tree levels with reflection

I'm constructing a dynamic query to get some fields from the database. I use a root object for that purpose and branch out from it. My_Custom_Object__c -> Account__r.Id So if I want to get an ...
6
votes
1answer
373 views

Salesforce API via the Python beatbox module

I am new to accessing Salesforce data via the API. I am using the beatbox library for Python. My code: import beatbox sf = beatbox.PythonClient() sf.login('my user name', 'my password + security ...
5
votes
3answers
2k views

How to find only those Schema.SObjectType types that are visible in the Schema Builder

I can find a map of all String -> Schema.SObjectType types by invoking Schema.getGlobalDescribe(). However, that includes a lot of object types I'm not interested in (like casecomment, ...
2
votes
1answer
103 views

Can't find ForecastingItem sObject in DescribeGlobalResult

We recently upgraded to salesforce API v27 (from 21). Documentation says that there are some new objects added between v21 and v27. ForecastingItem object is one such object. But when I get all the ...
1
vote
1answer
317 views

is it possible to do Describesobject for multiple sobjects via rest api?

Im trying to describe all the sobjects in my organization and fetch some information from each of them. When I use the partner wsdl, I can give something like this in c# DescribeGlobalResult dgr = ...
1
vote
1answer
540 views

Access the Related List Label for a Lookup relationship

I've searched high and low, and I can't seem to figure out the Apex syntax I need to use to access the Related List Label for a Lookup relationship. It shows up in the objectTranslation XML as ...
5
votes
1answer
502 views

How to get list of All Objects enabled with Activities?

Is there anyway we can find all Objects which have Activities enabled, in APEX?
6
votes
1answer
962 views

Field Sets & Dynamic DML & Describing Fields Included in Field Set

I am attempting to write generic code which will use a fieldset, allowing for dynamic creation of a query. This bit is documented well enough in dynamic DML examples from SFDC. In addition to the ...
6
votes
1answer
128 views

Can we describe all the page names in salesforce

We need to get all custom page names into the select box. Is there any way that we can describe all pages like objects
2
votes
1answer
265 views

Using describesObject to prevent null pointer exception whenever fields aren't populated in creating new Event

I'm writing a trigger to create a new Event on update of Opportunity. There are some required fields and others are optional in the form that the user submits. I'm trying to determine a good way to ...
9
votes
1answer
117 views

Can an Object Definition's ID be obtained programmatically?

I've noticed that SF related lists are anchored (#) by a concatenation of the current record's Id, an underscore, the Id of the related list's object definition, and then "_target" (e.g. ...