Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [schema]

Schema is a tag used to describe questions related to the dynamic processing of the system schema through the various describe methods.

Filter by
Sorted by
Tagged with
1 vote
0 answers
44 views

Traversing SObject Schema Relationship Depth Recursively

I'm trying to build a list of creatable and updatable lists that I will use later in my code to check for FLS, I want to allow a relationship depth of 2 and would like this to be changed at some point ...
Roy's user avatar
  • 11
0 votes
0 answers
42 views

Get master object from master-detail relationship by SOQL FieldDefinition object

Let's say we have SELECT DataType FROM FieldDefinition WHERE EntityDefinitionId='Opportunity_ROW_Segment_Junction__c' it works fine but is it possible to retrieve e.g. Opportunity as a single field ...
pincet's user avatar
  • 925
0 votes
0 answers
48 views

Need Help with Importing Salesforce Schema for Custom Fields

I've created a custom picklist called Discount_Type__c within the Opportunity Product object. Despite using the appropriate schema import statements in my JavaScript code, I'm encountering ...
Sridhar's user avatar
  • 49
0 votes
0 answers
19 views

How do you learn about fields on an Object if they are not shown in the Object Manager?

Periodically, I come across an object that has fields I can access in a Flow or perhaps a SOQL query but that are not listed in the Object Manager (either in Lightning or Classic). Is there a standard ...
kennyc's user avatar
  • 349
0 votes
0 answers
42 views

Salesforce Graphql Schema object is missing some field/objects

I'm currently experimenting with Salesforce GraphQL at https://.my.salesforce.com/services/data/v60.0/graphql. I've successfully pulled the GraphQL schema from the above URL, but unfortunately, some ...
vctqs1's user avatar
  • 85
0 votes
1 answer
64 views

Modifying Field Level Security throws an error

When trying to change the Field Level Security of a specific field, I am getting the following error: Error - Unable to Access Page You are missing information needed by the page you have attempted ...
Ishank's user avatar
  • 109
0 votes
1 answer
68 views

How to change the filterable property in a schema

I was working on an error in one of my queries and found filterable property in schema, and determined that filterable was set to false (using workbench as the aforementioned question answers). How do ...
zoboso's user avatar
  • 15
0 votes
1 answer
357 views

Schema.sObjectType.(...).isUpdateable() method is returning true but should return false

In short, I'm trying to follow the PMD Source Code Analyzer Project, and I realized that before making an update I must validate whether the user has permission to change the field (ApexCRUDViolation)....
Noops's user avatar
  • 3
0 votes
1 answer
223 views

Issue getting object API name from relationship field using Schema

In my project we are using fflib_QueryFactory to build queries and also order fields. Example is given below: fflib_QueryFactory qf = new fflib_QueryFactory(Account.SObjectType) ....
Jason Rickert's user avatar
0 votes
2 answers
1k views

How to query managed package objects

I'm trying to retrieve record values of a managed package custom object (call it abc__custom_object__c, where 'abc' is the package namespace, as an example). Trying to run the following SOQL query ...
lhh13's user avatar
  • 41
-2 votes
1 answer
172 views

Export several objects picklist details into CSV file using apex

Context We need to export picklist label and API values for several objects, in a csv file using apex. Several posts exist on this subject but the objective is to export picklist values for several ...
Shamina's user avatar
  • 4,275
0 votes
1 answer
1k views

Efficient way to get field API name using field label

I have an requirement where I need to get the field api name using field label. For example, If I have field called Spouse_Phone__c(label = Spouse Phone), In apex I want to fetch the api name for that ...
Jason Rickert's user avatar
1 vote
1 answer
871 views

After Enabling "Set Audit Fields upon Record Creation" Permission check for is createddate Creatable still returning false

I have set Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners User Permissions" permission checked true in userinterface. After that i am ...
Manjot Singh's user avatar
  • 3,516
3 votes
1 answer
142 views

getDescribe in standard Activity object returns a Null Pointer

I have the following statement for trying to getdescribe for the standard activity object Schema.SObjectType s = Schema.getGlobalDescribe().get('Activity') ; Schema.DescribeSObjectResult r = s....
Jay Rizzi's user avatar
  • 465
0 votes
1 answer
366 views

common.apex.runtime.impl.ApexFieldToken

We have using SmartFactory class from long time. But, recently we are facing issues while running smartfactory unit class. Smart Factory Git hub repo. When I try to see the logs I've found out this. I ...
Pavan tej's user avatar
  • 1,460
1 vote
1 answer
1k views

Schema.getGlobalDescribe().get(objectType); doesn't work with custom objects

I have a method that returns a map of all the fields where the field's API name is the key and the object Schema.SObjectField is the value. private static Map<String, Schema.SObjectField> ...
Jean's user avatar
  • 13
0 votes
1 answer
248 views

Get list of fields for History object via APEX

I need to dynamically retrieve the list of fields for history objects, whether it be Asset or Opportunity etc. I normally use the following code to retrieve these fields for standard and custom ...
ViqMontana's user avatar
1 vote
1 answer
231 views

Some History object still show "MISSING LABEL" message when use Schema to get label or get label plural

I try get some objects label or label plural by using Schema method, but for some of History objects I will get follow message in label and label plural: "__ MISSING LABEL __ PropertyFile - val ...
GhostLee's user avatar
1 vote
1 answer
1k views

How to retrieve reference field's value dynamically

sObject record = Database.query(query); // current record values Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Schema.SObjectType objSchema = schemaMap.get(objName); ...
sfdcOwl's user avatar
  • 45
2 votes
3 answers
9k views

Getting error for user fields in LWC component when using schema?

I am trying to retrive field information for user fields using following code. But except for the Name field of User, it is throwing error for every other field. Any idea why its not letting me access ...
Nachiket Deshpande's user avatar
0 votes
1 answer
489 views

Finding fields for standard data types

I've been trying to complete a challenge on trailhead (link here) The text says "Create an Apex trigger that sets an account’s Shipping Postal Code to match the Billing Postal Code if the Match ...
Frans's user avatar
  • 29
1 vote
0 answers
296 views

How to get the Field Label from the Columns retrieved from the List view Metadata?

I have written an Metadata API from https://github.com/financialforcedev/apex-mdapi to get the List view details. Below is my code: MetadataService.MetadataPort service = MetadataServiceExamples....
Rahul Allada's user avatar
0 votes
0 answers
79 views

Can't access RecordTypeId of Account object

I'm not sure why I can't access the RecordTypeId or any sort of recordtype field of the Account object. //error at select Account[] accs = [SELECT RecordTypeID, TYPE FROM Account]; Schema....
Bryar's user avatar
  • 1
0 votes
1 answer
552 views

need to capture lastmodifiedBy user and date of LWC in salesforce

I have requirement where i need to fetch modified lwcComponent with the user who modified it programmatically. Is there any soql query we can use or by apex schema we can get it.Audit trail does not ...
sam's user avatar
  • 1
4 votes
1 answer
234 views

Can a Number field in a managed package be changed to a Currency field of the same precision and scale?

Such a change can be made using sfdx force:source:push, presumably because there isn't any risk of data loss (mentioned in Notes on Changing Custom Field Types). Can this change be packaged and orgs ...
Keith C's user avatar
  • 136k
0 votes
1 answer
3k views

(Schema.SObjectType) || Method does not exist or incorrect signature: void

I'm trying to list the Record Types that a user has access to. Unfortunately, this cannot be done through SOQL Query (IIRC) and the only choice I have would be to either use Schema.SObjectType (Apex) ...
VanceSOQL's user avatar
  • 103
1 vote
2 answers
2k views

Check field is updatable

I have object and field name, but don't understand how to check if that field isUpdatable. It gives me the error: Variable does not exist: fields SObjectType objectType = Schema.getGlobalDescribe()....
Samuelid's user avatar
6 votes
0 answers
301 views

APEX Schema ChildRelationships: why have some relationships their relationshipName = null?

There is some strangeness in the some standard Childrelationships. Most Relationships are as expected, but let us take Account and Quote as an example: On Quote we have a standard lookup field Quote....
Uwe Heim's user avatar
  • 28.4k
1 vote
1 answer
5k views

Get parent record fields using getRecord uiRecordApi in lwc

I'm trying to get parent record value using uiRecordApi in my lwc component. But I'm getting error. Cannot read property 'value' of undefined import OPPORTUNITY_ISCLOSED from '@salesforce/schema/...
salesforce Developer's user avatar
0 votes
1 answer
1k views

Retrieve the type of field using Schema classes

I am trying to create a generic class to retrieve the type of a field for any sObject. I am struggling with the following part of the code: String[] fields = ['Id','Name']; for(sObject o : ...
arpit gupta's user avatar
0 votes
0 answers
557 views

How to access the value of Schema.sObjectField?

I am new to apex coding, Can anyone please help me here? I am working on after update trigger and I am using the below code to know what fields were updated. I got a code on StackExchange that serves ...
M Dhanapal's user avatar
0 votes
1 answer
154 views

Will a query from Organization ever return more than one row?

I'm curious. Is it possible for the query below to return more than one row? Do Divisions somehow create multiple Organization rows within an org? SELECT Id, Division FROM Organization
muchavie's user avatar
  • 492
2 votes
2 answers
2k views

Dynamically get object info

I see so many examples like below; however, I want to be able to pass a string that holds 'Account' or custom object name for example. The examples I see on SF are hard coding Account. The reason I ...
TomB's user avatar
  • 33
0 votes
1 answer
629 views

How to get rid of Master Record Type on custom Record Type Lookup?

I created custom lookup with all possible Record Types to choose by user. I simply retreive List with Record Type Infos from Schema globalDescribe and pass it from apex controller to aura component. ...
Grzegorz Połuch's user avatar
1 vote
1 answer
277 views

DescribeSObjectResult cannot find field

Let's say we have a simple code Schema.DescribeSObjectResult res = Schema.SObjectType.Account; system.debug(Schema.SObjectType.Account.fields.Name.isAccessible()); system.debug(res.fields.Name....
pincet's user avatar
  • 925
0 votes
0 answers
645 views

How to query formula field and related object field values by Schema class

I have this below method when I am passing fields dynamically to get passed object records. relatedObjectName ==> Planner__c recId ==> RecordId of Planner__c fields = AccountPlanner__r.Email (...
user2542953's user avatar
0 votes
1 answer
1k views

How to get a list of Field Set names in Apex [duplicate]

I need to create combobox with Field Set names. I know how to get fields for any Field Set, but how to get a list of all Field Set names. Map<String, Schema.FieldSet> canMap = Schema.SObjectType....
Valentin Romanov's user avatar
-1 votes
1 answer
871 views

Get user's last assignment (or re-assignment) to profile or permission set datetime

Is it possible? Let's say we have a lot of users, profiles and permsets. There is need to get last datetime when user was assigned to particular permset or profile using SOQL. Which fields could help?
pincet's user avatar
  • 925
1 vote
0 answers
27 views

Customer 360 Audiences Web and Mobile Application JSON Schema

I have gone through the following documentation regarding creating an Event Type JSON schema for the mobile or web application connector in Customer 360 Audiences: https://help.salesforce.com/...
Glen Chen's user avatar
1 vote
0 answers
643 views

How do I get the API specification or schema for a custom REST endpoint?

How do I get the API specification or schema for a custom REST endpoint? I'm looking for something basic, similar to the examples provided within this documentation for OpenAPI Specification. The end ...
DMendoza's user avatar
  • 111
0 votes
1 answer
6k views

Deserialize a JSON to a List<SObject>

I have an Apex class which has a method having an Object type parameter public with sharing class DmlOnSObjectRecords { @AuraEnabled(cacheable=false) public static void dmlOperationOnSObjectRecords(...
Madhurima's user avatar
  • 1,395
1 vote
1 answer
310 views

Schema.describeTabs() returns empty DescribeTabSetResult

I have a piece of Apex code that does Schema.describeTabs() When i run this as System Administrator, i get the tabs back just fine. Some other users running this code get empty List<Schema....
zaitsman's user avatar
  • 1,930
0 votes
1 answer
168 views

Mysterious "Long" DisplayType

I'm trying to figure out what "Long" DisplayType is (it's listed in Schema.DisplayType Enum values). I've checked standard fields for a couple of SF standard objects but didn't find any ...
Evgenii Orekhov's user avatar
0 votes
1 answer
869 views

filterable property in schema

how to get fields which are queryable(can be used in query) or filterable(property from schema) from an object like account without using soql queries. Any suggestions? how to achieve this.
user avatar
1 vote
1 answer
946 views

get count of all the fields containing data in a specific object

public static Map<String, decimal> getFieldsCount(String objectName){ Map<string,Schema.SObjectField> get_F_name=Schema.getGlobalDescribe().get(objectName).getDescribe()....
user avatar
2 votes
1 answer
780 views

Get list of all required fields of sObject dynamically in Salesforce

I want to build a list of fields marked required at the schema level. I have tried below snippet, It works great but fails for the field with default values. Map<String, Schema.SObjectType> m = ...
Akshay Poddar's user avatar
0 votes
1 answer
1k views

get custom setting fields names in apex class

Requirement-I need to create a map of custom setting in apex class with fields and value like. "Name":"test", "cal__c":"tesq", "industry__c":"...
ajay bagdad's user avatar
1 vote
0 answers
125 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 ...
Tyler Dahle's user avatar
  • 2,709
1 vote
1 answer
2k views

LWC UI Object Info API get only particular Field Label

The lightning/uiObjectInfoApi module includes wire adapters to get object metadata and picklist values. getObjectInfo -> Can we fetch only metadata of particular field instead of whole object ...
vkm's user avatar
  • 137
3 votes
1 answer
13k views

LWC: Unable to fetch custom field through the schema

I have a LWC component in which I am trying to pull the metadata from the schema so I can use updateRecord. I've done this before for a different custom object(and it worked) but this time I am ...
Arthlete's user avatar
  • 4,907

1
2 3 4 5