Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [describefieldresult]

is a class that contains methods for describing sObject fields.

3
votes
1answer
59 views

In order to check if a field is required or not, is the result of isNillable method sufficient?

Accordingly to the documentation of isNillable method of Schema.DescribeFieldResult class: isNillable() Returns true if the field is nillable, false otherwise. A nillable field can have ...
3
votes
1answer
29 views

Identifying the controlling picklist of a dependent picklist

Is it possible to identify the controlling picklist for a dependent picklist in Apex. Currently, I am using the DescribeFieldResult class to get information on object fields; type, name, length, etc. ...
2
votes
0answers
26 views

Field History object - value of column “Field” when tracked field is lookup (standard v custom)

I'm trying to selectively delete an SObject's field histories based on the members of an sobject's fieldset (think PII deletion - feature available V42). Example: OOTB Order with field set containing:...
3
votes
1answer
40 views

When is the AccountId field not available as a merge field for JS buttons

May be a basic question but I could not find specific documentation and I need to find out all objects where: The accountid field is NOT available as a merge field is a javascript button. In these ...
4
votes
2answers
88 views

SObjectType.newSobject(null, true) doesn't populate default values if called in vf action method, any tips?

I'm trying to create an sObject instance using following code: Schema.SObjectType targetType = Schema.getGlobalDescribe().get(objectName); sObject sObj = targetType.newSObject(null, true); This ...
8
votes
1answer
58 views

What are the 'magic' fields of Salesforce (e.g. Case.Comments)?

I am writing a SOQL generator that grabs the list of readable fields for an object and creates a query to fetch the data. (Unrelated, but because "Why?" is often asked - this subroutine is part of a ...
0
votes
1answer
27 views

How to get Two articles in One list using salesforce query

Hi every one I have a two articles: Offer__kav and Offer_order__kav. How to Query This Two Objects Related All Fields. For Ex: I tried : List<List<SObject>> search_results = [FIND 'SFDC'...
4
votes
1answer
72 views

How do I find out if a field is updateable by the System?

I am running a batch process that is marked without sharing. I would like to to take one course of action if the batch process can update a particular field, and another if not. For example: if (...
0
votes
0answers
152 views

How to Comparable interface sort a List<String> of Schema.DescribeFieldResult.getName() entries by many DescribeFieldResult properties?

I use str to dynamically generate input fields on a visualforce page. Unlike standard page layouts that come with a drag and drop layout editor, my page's positioning of input fields depends on the ...
2
votes
1answer
155 views

Programatically how can I link Case Status Values to a Defined Business/Support Process

I am trying to create a custom visualforce page that is aware of the Case Status Values that are related to a specific Case Support Process. I am able to get all Status Picklist Values from a ...
2
votes
1answer
54 views

Get All User References fields

I want to get dynamically all field for object (assume for Account) which are User reference . Using the describe method I can check that the field is Reference type but not clear how/if can I check ...
2
votes
2answers
751 views

Is there a way to read all Inactive values of Picklist?

Here is my code. I'm trying to read Picklist Values via code, but I also intend to find out all Inactive Values on the field as well, but those values are not getting called in below code: list<...
1
vote
0answers
72 views

How can the Describe for a Field of getPopulatedFieldsAsMap() be null

I'm doing a CRUD check on Field level, since under some weird circumstances our customers don't have update rights on Record level, but only on fields (it's a guest license). So in addition to the ...
0
votes
2answers
379 views

Dynamic SObject API Name from Object Label

Is there a way to fetch the Object API Name using the Dynamic Object label and Schema. The other way around i have done. But i need this way to get SF API Names to be sent through Rest. I tried for ...
1
vote
1answer
58 views

getRelationshipOrder() returning null

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong? Here's the relevant ...
8
votes
3answers
156 views

Any way to check a field's updateablity ignoring profiles?

The DescribeFieldResult.isUpdateable method incorporates the "Edit Access" setting of the Field level Security for a field i.e. it considers the field settings in the current profile. Is there a way ...
1
vote
1answer
241 views

“Field User.LastPasswordChangeDate is inaccessible in this context” when running 'Schema.sObjectField.getDescribe()'

The issue occurs when a bit more restricted profile is being used, so I am still reviewing whether it is actually the cause or if it's something else. n.b. we are working in a namespaced scratch org, ...
8
votes
0answers
149 views

REST API error middlename,suffix,informalname fields do not exist but they appear in describe results

We develop a AppExchange package and are having an issue with middlename,suffix,informalname fields on the Contact object. The issue is these fields are returned through a describe call also filtering ...
0
votes
2answers
273 views

How do I find the field type of parent/grandparent fields etc?

I have in my SQL relationship fields. The have written this query under a custom object. ex: SELECT name,Contact__r.Account.CreatedBy.Name FROM Four_Level_Check__c LIMIT 5 My need is to find the ...
4
votes
1answer
146 views

How do we get Index fields of an Object in Apex?

I want all the index fields of a particular object in apex. I have searched through the Schema describe but couldn't find a way to identify the field as indexed.
9
votes
1answer
281 views

What is the difference between creatable vs. updatable on Schema.DescribeFieldResult

When writing CRUD and FLS checks in apex I have noticed that I can check for the following: Schema.DescribeFieldResult fieldDescribe = field.getDescribe(); fieldDescribe.accessible; fieldDescribe....
0
votes
1answer
248 views

Reading Lookup Filter criteria from SObject field descriptions?

We are implementing a special type of lookup window in a VisualForce page, which displays a set of potential records a user can select from to populate a Lookup value. As a means to allow users to ...
7
votes
1answer
184 views

How to differ between rollup-summary and formula fields using APEX Schema functions?

I'm using describe functions to retrieve a DescribeFieldResult. Now on an Object I have two fields: one is a formula and the other is a rollup-summary. How can I differentiate between these two "types"...
0
votes
1answer
44 views

Match two Sobject field API Names and put the common in a Set

I am trying to pass two Sobject names to a method and match using Schema the Field API Names common in both of them. Like I have Object1 having fields A__c, B__c,X__c. Object2 having fields A__c, ...
0
votes
1answer
240 views

Contact Fields not visible on Person Account

According to this document when Person Accounts is enabled for the Salesforce Org, there should be new fields added to the Account object (PersonMailingCountry, PersonMailingCity, etc.). However, when ...
0
votes
0answers
284 views

Get SObjectField with same API Name dynamically across SObjects

I have a unique situation. I have several different SObjects that are using the same field API names and I'm trying to get them dynamically by passing the SObjectType. For instance. This is for a ...
0
votes
1answer
1k views

Object and Field Describe in Lightning Component

Is it possible to get sObjectDescribe in Lightning Components? In my case I need to have all possible values of picklist-field, but filter out the list of options conditionally.
0
votes
2answers
129 views

How to put in VF page a link to the full list of related records of a parent?

I've seen that when a related list in a record's detail page surpasses 5 (or something) records, there is a link in the bottom that navigates to the full list of related records and nothing else. In ...
4
votes
1answer
152 views

Is There an Easy Way to Retrieve Field's External Alias

When creating custom fields on external objects you have the ability to add "External Alias / External Column Name" of the corresponding field name in the external data source. I've got a situation ...
6
votes
0answers
64 views

Is there is any way to get standard field api name from standard report types reports in apex?

I want to get the api name of the standard field being used in Reports of Standard report types. I used describe methods to get the columns used in a report. I analysed some of standard reports ...
6
votes
1answer
71 views

FieldPermissions.Field contains strings longer than described maximum

I'm investigating an issue where values of one of the columns on the "FieldPermissions" object get truncated when we sync them to a DB. The column in question is called "Field", and it contains the ...
7
votes
2answers
527 views

How to efficiently determine the `name` field of an sobject for dynamic query?

Is there a more efficient way to determine the name field of an sobject other than iterating through all the fields obtained via DescribeSOBjectResult? Often, the name field is simply Name but in ...
1
vote
1answer
42 views

DescribeSObjectResult not fetching Picklist

Need urgent Help I am executing the following code in execute anonymous. String objtype = 'Lead'; SObject objToBeCreated ; if(objtype == 'User') objToBeCreated = new User(); ...
2
votes
1answer
224 views

How can I distinguish the different Textarea fields in apex?

In Salesforce there are 3 different Text Area fields: Text Area, Text Area (Long), and Text Area (Rich). I'm doing some processing in a custom class and I need to distinguish between the 3 ...
1
vote
1answer
640 views

Does the “Only” part of the “Due Date Only” label of Task.ActivityDate have some significance?

This describe call: Task.ActivityDate.getDescribe().getLabel() returns "Due Date Only" rather than "Due Date" (that is used in e.g. the Task edit page). Is there some significance to the "Only" ...
1
vote
1answer
476 views

Schema sObjectType [Object] fields isUpdateable returns false despite profile config

Schema.sObjectType.Campaign.fields.My_CustObj_Id__c.isAccessible() // true Schema.sObjectType.Campaign.fields.My_CustObj_Id__c.isUpdateable() // false How is this possible?
0
votes
2answers
121 views

Accessing static helper method in Visualforce page

I'm trying to access helper method from Visualforce page directly and I'm not sure if this possible and I'm getting the following error below and with the code I have. Error Error: Unknown ...
0
votes
1answer
383 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 ...
3
votes
2answers
158 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 ...
4
votes
2answers
1k 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 ...
1
vote
1answer
1k views

Get opportunity stages for specific sales process

I would like to get the available stages for a specific opportunity sales process via code. BusinessProcess and RecordType objects are not connected to the OpportunityStage object. The code below ...
7
votes
1answer
401 views

Schema.SobjectField Access Changed in API v34.0 (Summer '15)

While I was working on a Visualforce page which has some similar functionality to another page that has already been developed in the past into one of my other orgs, I decided to re-use the same code ...
10
votes
1answer
7k 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
34 views

Do standard lookups always follow: FieldName = RelationshipName + “Id”?

Can we say that all standard lookups/master-details/polymorphic fields follow a consistent naming convention across all standard objects? I'm talking about this pattern: field name = field ...
3
votes
2answers
405 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
0answers
35 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 ...
6
votes
1answer
502 views

Apex mechanism for determining if standard field is automatically calculated?

Is there any mechanism in apex for determining if a standard field's value on an sObject is automatically calculated by the platform? (Essentially a roll-up summary field.) A custom roll up summary ...
0
votes
1answer
54 views

Consideration of fields to be used in SOQL Group By [duplicate]

I have come to know that a few fields in Salesforce.com are not groupable and that we can make sure whether field is group-able or not with getDescribeSObject. I would like to know what are the ...
3
votes
1answer
738 views

If I have the api name of a field, how can I get the label?

I have the API Name of a custom field on a knowledge article stored a string kav.articleType = 'Frequently_Asked_Question__kav'; where kav is a KnowledgeArticleVersion object. How can I get the ...
3
votes
1answer
2k 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(...