Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [describefieldresult]

is a class that contains methods for describing sObject fields.

Filter by
Sorted by
Tagged with
6 votes
1 answer
149 views

How to find the encrypted fields from inside an LWC?

I have Shield Platform Encryption turned on for Account.Name and a server-side field describe call: System.debug(JSON.serializePretty(Account.Name.getDescribe())); returns as expected these ...
user avatar
  • 129k
4 votes
1 answer
63 views

DescribeFieldResult .IsCascadeDelete()/isRestrictedDelete() don't return the correct value for Opportunity.AccountId/Case.AccountId fields

In Case Object there is a "special" lookup field to Account, with the API Name AccountId and Label Account Id (btw in the UI we see Account Name as the field's label which is the name we ...
user avatar
  • 41
0 votes
1 answer
152 views

Determine `SObject type` from relationship name without an exhaustive search

Consider a general relation 'Foo.Bar' and some SObject type. An example might be 'Account.Id' and an Opportunity.SObjectType. Can I determine SObjectType Foo is referring to without getting the field ...
user avatar
  • 3,605
1 vote
1 answer
346 views

Using Apex to query Country Picklist Integration Values

We are using global country picklist in our org. For historical reasons, some of our countries have a difference in the name of the country and the integration value of the country. From Apex, I ...
user avatar
  • 2,601
0 votes
2 answers
371 views

Is an Address and Location SObjects or a Compound Fields?

I am trying to build a picklist which would display all the available SObject, and global describe returns me some strange SObject Address, when I try to instantiate dynamically this SObject, it fails ...
user avatar
  • 13.2k
0 votes
1 answer
58 views

Use multiple languages on Schema.DescribeFieldResult

Is it possible to pass language on Schema.DescribeFieldResult so that I can get the field labels translated in multiple languages in apex?
user avatar
  • 7
0 votes
1 answer
132 views

How to get pedefined field value mentioned in QuickAction?

Quick Action : SendMail I want to get predefined values using Apex QuickAction.QuickActionRequest req = new QuickAction.QuickActionRequest(); req.quickActionName = Schema.Case.QuickAction.SendEmail;...
user avatar
  • 31
1 vote
1 answer
129 views

Get dependent picklist name from controller picklist name using APEX

I got a situation that if I pass the controlling picklist name then I have to find the dependent picklist field name using APEX. I know the vice versa can be achieved though ie , Dependent ----> ...
user avatar
1 vote
1 answer
37 views

Why Does Describe Information Always Return True for Updateable on Read-Only Fields?

I cloned the Administrator profile, removed the Edit permission for some fields on Opportunity Product, and applied the cloned profile to a non-admin user. I logged in as this user and went to a ...
user avatar
  • 130
1 vote
0 answers
67 views

No such field ActivityOriginType even though returned through field map

We have an all fields query that gets the field map from an object's describe in Apex. It then loops over the map and assembles a query. In one clients org, the field map is spitting out ...
user avatar
  • 2,319
3 votes
0 answers
704 views

Get the active and inactive values from the Picklist

I'm trying to get the active and inactive values, especially the inactive ones, from a picklist to activate them via code. The problem is that I can only get the active values. List<String> ...
user avatar
  • 111
2 votes
0 answers
689 views

DescribeFieldResult.getReferenceTo returns only one type in a specific scenario

I am seeing some strange behavior where DescribeFieldResult.getReferenceTo returns only one type for the Lead.OwnerId field in some cases when invoked in a trigger context. The code below displays ...
user avatar
4 votes
1 answer
764 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 ...
user avatar
3 votes
1 answer
180 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. ...
user avatar
2 votes
0 answers
107 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:...
user avatar
  • 61.5k
3 votes
1 answer
351 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 ...
user avatar
  • 53.1k
4 votes
2 answers
362 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 ...
user avatar
  • 5,596
8 votes
1 answer
157 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 ...
user avatar
  • 93
0 votes
1 answer
33 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'...
user avatar
  • 13
4 votes
1 answer
286 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 (...
user avatar
0 votes
0 answers
366 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 ...
user avatar
  • 1,080
3 votes
2 answers
600 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 ...
user avatar
  • 2,852
2 votes
1 answer
72 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 ...
user avatar
  • 1,535
4 votes
3 answers
5k 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<...
user avatar
  • 5,596
1 vote
0 answers
280 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 ...
user avatar
  • 6,120
0 votes
2 answers
2k 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 ...
user avatar
  • 585
1 vote
1 answer
210 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 ...
user avatar
  • 4,896
8 votes
3 answers
404 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 ...
user avatar
  • 129k
1 vote
1 answer
761 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, ...
user avatar
  • 4,429
9 votes
0 answers
430 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 ...
user avatar
  • 4,896
0 votes
2 answers
1k 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 ...
user avatar
  • 351
4 votes
1 answer
574 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.
user avatar
  • 61
9 votes
1 answer
904 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....
user avatar
0 votes
3 answers
1k 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 ...
user avatar
  • 87
7 votes
1 answer
399 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"...
user avatar
  • 33.6k
0 votes
1 answer
244 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, ...
user avatar
  • 2,900
0 votes
0 answers
439 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 ...
user avatar
  • 765
0 votes
1 answer
2k 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.
user avatar
0 votes
2 answers
214 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 ...
user avatar
4 votes
1 answer
280 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 ...
user avatar
9 votes
1 answer
407 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 ...
user avatar
6 votes
1 answer
112 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 ...
user avatar
10 votes
2 answers
1k 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 ...
user avatar
  • 3,976
1 vote
1 answer
55 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(); ...
user avatar
2 votes
1 answer
495 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 ...
user avatar
  • 2,996
2 votes
1 answer
2k 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" ...
user avatar
  • 129k
1 vote
1 answer
1k 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?
user avatar
  • 2,613
0 votes
2 answers
316 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 ...
user avatar
  • 6,561
0 votes
1 answer
854 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 ...
user avatar
3 votes
2 answers
325 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 ...
user avatar
  • 8,543