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
28 views

Dynamic Describe Result

Schema.DescribeFieldResult field = Opportunity.StageName.getDescribe(); List<Schema.PicklistEntry> PL = field.getPicklistValues(); I am trying to do this:I want to replace field name ...
0
votes
1answer
45 views

From Parent ID, dynamically derive child's lookup field name/token

I'm trying to save a new record dynamically, but I'm having a problem with a lookup field. For instance, I'm able to get the parent object with the id. Id relatedID = '<someId>'; SObjectType ...
3
votes
1answer
42 views

Apex: Retrieve the URL of a custom object setup detail

I'm trying to get a list of all objects and the URLs that lead to their page in the Setup: From the docs I'd expect the below to work but it returns: "Expression of type Schema....
3
votes
2answers
48 views

DescribeFieldResult.getSOAPType() returns type not in enum list

Was working on some generic apex, and wrote a few lines of code to get the SOAPType of a field based on the type and the name. Went off, and worked on some other areas, and wrote something which used ...
1
vote
2answers
27 views

DescribeAsync Method usage using C# .Net API

I need to get the label name from custom object. I'm using the C# .Net SalesForce API and try to use the DescribeAsync call on my Objects. It seems to be working, but I don't know how to parse the ...
0
votes
2answers
22 views

Overwrite an SObject with another SObject without losing related records

In Apex is there an efficient way to overwrite an SObject instance with another SObject (both of the same type) without losing parent and children records? In the following example I want to replace ...
3
votes
1answer
221 views

Get all Parent and child objects related to the current object

I have a string which contain the name of a sobject. Now I want to get all the objects related to this object. Also want to get which kind of relationship it have with these object.
2
votes
1answer
73 views

Which Objects are displayed in PermissionSet Object Settings?

I am a noob with Salesforce, please bare with my question. I am creating an App which enables easy edit/creation of PermissionSets on an ORG. In this process, I am creating a tree view with ...
3
votes
2answers
85 views

Describing the Name field of a Custom Object to get Auto Number

I want to check if the (standard) Name field of an object is an auto number field or not. This can be done by describing the field and using isAutonumber()Salesforce Documentation. I have a custom ...
0
votes
1answer
33 views

Report to identify Custom / Standard Salesforce Objects

Is there there an easy way which i can produce a Salesforce report which returns the following headers ; Singular Label Plural Label Object Name API Name Custom Desired outcome would be ; ...
0
votes
0answers
22 views

Search through metadata all fields with a specific pattern and then translate the same

There is a requirement to translate All the fields/ Objects/ Layouts that starts with a Particular Keyword say OK and replace it with DP. Currently i'm using Schema.DescribeSObjectResult to extract ...
0
votes
1answer
41 views

Custom field not showing in list of described object

I am working on an integration using JSforce to query the Salesforce API for data. When I run a describe('object'), I get a list of fields that are contained within said object, including custom ...
0
votes
1answer
259 views

Compatible Schema.DisplayType For SObject Put

I'm trying to write a method for working with sObject.put(field, value) statements in a loop where the Schema.DisplayType of the fields received varies. The goal is to have the method return the name ...
2
votes
1answer
44 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
76 views

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

Our current strategy for pulling layouts is as follows: first we attempt to retrive data from the describe/layouts endpoint, here this fails (returns body.layouts of null) [ "SF makerequest end", "...
0
votes
1answer
46 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 '+dfr....
0
votes
0answers
37 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 ...
2
votes
4answers
738 views

Retrieve API names of All object in Salesforce ORG using SOQL

How to write SOQL query to retrieve all the object Name and API names of Sobject in Salesforce
2
votes
1answer
65 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 ...
3
votes
1answer
188 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(); for(...
0
votes
0answers
41 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
17 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
177 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
94 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
28 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
53 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
106 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
107 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
81 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 ...
4
votes
1answer
179 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 doesn'...
3
votes
1answer
123 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
290 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
21 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
41 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
60 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
40 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
169 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: { ... ...
2
votes
1answer
82 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 ...
6
votes
1answer
178 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
841 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
269 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
202 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
32 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
5k 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
37 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 ...
4
votes
1answer
345 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
346 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
757 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 = Database.query(...
6
votes
1answer
323 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 ...