Questions tagged [describefieldresult]
is a class that contains methods for describing sObject fields.
81
questions
0
votes
2answers
19 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 ...
0
votes
1answer
21 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?
0
votes
1answer
45 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;...
0
votes
1answer
20 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 ----> ...
1
vote
1answer
27 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 ...
1
vote
0answers
27 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 ...
1
vote
0answers
167 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> ...
2
votes
0answers
278 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 ...
3
votes
1answer
313 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
147 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
63 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
170 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
236 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
106 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
32 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
148 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
304 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
352 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
62 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
3answers
3k 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
193 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
1k 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
159 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
288 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
499 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
302 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
739 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
329 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
640 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
2answers
734 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
282 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
119 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
786 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
407 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
178 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
209 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 ...
7
votes
0answers
114 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
89 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 ...
8
votes
2answers
940 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
49 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
369 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 ...
2
votes
1answer
1k 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
792 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
235 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
675 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
241 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
2k 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 ...
2
votes
1answer
2k 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
442 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 ...