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
0
votes
0answers
29 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 ...
0
votes
1answer
57 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(...
0
votes
0answers
28 views

1-to-many relationship in data designer using salesforce data

We're having an issue regarding data designer in MC. Within schema builder in our SF org we have a custom object which has 2 lookups fields related to the same contact object. The 1st field called'...
1
vote
0answers
26 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....
0
votes
1answer
27 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 ...
0
votes
1answer
25 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.
0
votes
1answer
56 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()....
2
votes
1answer
78 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 = ...
0
votes
1answer
28 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":"...
1
vote
0answers
33 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 ...
0
votes
0answers
32 views

Receiving Error: 'Error encountered while saving External Registration. Please try again later.' while adding new (enhanced) External Service

Similar to question: While trying to use the External Sevices I get the error “Error encountered while saving External Registration. Please try again later.” I am unable to save the schema and ...
0
votes
1answer
384 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 ...
2
votes
0answers
711 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 ...
0
votes
0answers
15 views

Neat way to get a field reference to the child relationship from a parent SObject?

I'm looking at how to neatly and generically retrieve the child objects from an SObject. I was expecting to use SObject.getSObjects(SObjectField field) (NB that documentation is wrong - it currently ...
1
vote
1answer
27 views

How to pass the parameter to which an object needs to be cast to

I have the following piece of code where I wish to cast a certain object to a specific SObjectType. public static void someMethod(Object obj, Schema.DescribeSObjectResult objectType){ ... ...
0
votes
1answer
38 views

Capture States on Account where the Account is doing business

I am trying to establish relationship between Accounts of different Recordtypes Account: CustomerID = BYR1 , RecordType = Buyer, Located IN = OH Account: L1, RecordType = Lender , Doing Business In ...
0
votes
1answer
248 views

How to delete child records in Lookup relation on deletion of parent record?

My child object already have 2 Master detail fields on it so I am unable to create 3rd one. I want functionality like Master detail. If user deletes any of parent record on parent object all the child ...
0
votes
0answers
20 views

JSON Wrapper with APEX: prepping for Salesforce Dev 1 cert

I'm studying up for my exam and found this code sample. It's syntax is unclear to me. mainly the .class and the getter and setter. I noticed that I can take any prop from the serialized object and ...
1
vote
0answers
29 views

How to use DuplicateRecordSet field: SobjectType

According to the documentation, DuplicateRecordSet there is a field SobjectType, however, after running the following code in Execute Anonymous, it doesn't appear that this field exists... Map<...
0
votes
0answers
306 views

Enhanced External Services and a REST API that wants header parameters

External REST API with its OpenAPI definition: "paths":{ "/":{ "post":{ "summary":"Sends phone number for validation", "description":"", "...
-1
votes
1answer
30 views

writing a program for Transferring ownership owner to owner for all objects

I'm writing a program for transferring ownership dynamically. But It has to work for all objects. Public Class TransferOwnership{ @AuraEnabled public static string tranferRecordOwnership(String obj,...
0
votes
1answer
125 views

How to get last created record date of all custom objects having total number of records greater than 1 lakh

My requirement as part of org analysis is to get list of all custom objects having more than 100000 records and created date of LAST CREATED record. My tries are as follows:- Go to Setup - Storage ...
0
votes
1answer
50 views

How to use a SOQL query for Sobjects like Passing Sobject as Variable inside the quey

I'm trying to write a SOQL query, But this query have to work for all object in one query. I want to use same query but I want to change object name dynamically public class Test { public static ...
1
vote
0answers
46 views

Avro schema (or Json) for SObject, Platform Events and SOQL queries

I would like to generate Schema for SObjects, Platform Events and SOQL so to be used in a typed programming language. I see it is possible to obtain the Avro schema for Platform Events here: https://...
0
votes
1answer
59 views

Error with RequestsForAccessSIQ

Hi I am working in a migration of metadata from one org to another. I am having the following error related to an object called "RequestsForAccessSIQ". Invalid fullName, must end in a custom ...
1
vote
0answers
107 views

Schema.getGlobalDescribe not showing all standard object even from System Admin Profile

I am trying to run very simple code in a static method under classs. Method: public class TestUtil { public static void testMethod1() { for(String str : Schema.getGlobalDescribe().keyset()...
-1
votes
1answer
46 views

SOQL to schema converison

public static map<id,RecordType> MapRecordtype = new Map<id,RecordType>([SELECT id, DeveloperName FROM RecordType where sobjecttype ='move__c' and ...
-2
votes
1answer
59 views

How to convert Query to Schema [duplicate]

I want to obtain record type info like: List<RecordType> lstrecord = new List<RecordType>([Select id,Name from RecordType where sObjectType = 'Move__c' and Name = 'Draft' ]); using ...
-1
votes
1answer
45 views

How to only on field history enable object in apex?

We have 5 objects. In these objects, we are only tracking 3 objects field history, How can I query on enable history objects How how to get only field history enabled object Name Please help me in ...
5
votes
1answer
142 views

Get Schema of all sObjects in one Api Call, like Schema Builder

I am building a web tool to get the schema of a particular sObject, or an entire org, and save it as a Json file using the SalesForce Rest API. To do this, I am first getting a list of all the ...
4
votes
0answers
633 views

lwc getFieldValue from a custom external object

I am creating a LWC that handles data from an external object. I have access to the recordId through @api recordId;, but I need to get the externalId from this object as well. Currently, I have call ...
0
votes
2answers
125 views

How to use a Schema.SObjectType as a variable to instantiate a set?

I am trying to create a class that can take in multiple different objects(one at a time), and work from there with the data it is passed in. Code is as follows: public static void createCharges(List&...
0
votes
1answer
76 views

How to get hierarchy of all objects dynamically through schema code

How to get a hierarchy of all objects dynamically through schema code in Salesforce I have code like below. Set<String> strForRelatedObjects = new Set<String>(); Schema.SObjectType ...
0
votes
2answers
111 views

Object Relationship Tree

I am currently trying to figure out how to elicit an object relationship tree from Salesforce, so I can export test data to use in my Scratch-Orgs. Basically what I want to do is poll to produce a ...
3
votes
2answers
968 views

Get list of all Custom Tabs in an org, including the creator of each

We are trying to clean up the tabs in a demo org (we've reached the limit of 100). I've been looking for a Metadata or Schema API, preferably one I can use from Apex, that will let me query for a ...
1
vote
0answers
44 views

Error while creating flow for external services

I am trying to pull information from the Editorial Manager API and sync it with Salesforce records but I'm having trouble. I wrote a custom schema and also finished a flow. I am getting an error when ...
2
votes
2answers
4k views

LWC Field Schema in HTML

I was wondering how to connect the FieldApiName from the schema and html in the right way and haven't found any useful information yet: My First approach was like this: value={Account[...
0
votes
1answer
35 views

Use Schema in Trigger

In attempting to "Bulkify" my trigger, it was suggested that I use Schema for getting RecordTypeId. As I'm not really a developer (I'm just taking a stab at updating the code that was created by a ...
4
votes
1answer
128 views

Is there a way in Apex to dynamically determine the ApiVersion the current code is executed with?

Assume we have an Apex class myClass.cls and we use it on several different Orgs. While the source-code is the same, on some Orgs we use different ApiVersion, e.g. some Orgs use v45.0, others use v42....
1
vote
1answer
106 views

How to use Schema class in Trigger to update a related child object feild?

Requirement : create a field called 'ExternalRef' on all child objects of Opportunity Object write a trigger on Opportunity that updates the new field on all child objects of opportunity to 'Rajsheakr'...
0
votes
0answers
257 views

Populate XML with XSD Schema

I was provided an XML schema that (I think) I should be able to utilize to build out the XML string that I need to send to a web service. The two documented items in the Apex Developer Guide talk ...
3
votes
1answer
497 views

How to improve schema access performance [duplicate]

We have Apex code that needs to interrogate the schema to dynamically handle configuration-based behaviour (e.g. for defining fields that should be loaded or saved) for specific types of object (such ...
0
votes
4answers
264 views

How to find the schema for a sobject

I am trying to build an API which under the hood will perform CRUD operations against the Salesforce API. I'm using the node-salesforce library for communication with Salesforce. An example of ...
0
votes
1answer
36 views

prevent to get Id field/Field label

All Fields label are getting in this list but i don't want ID field from below code how to avoid ID field label. public List<String> AllLabels{get;set;} String type='Account'; Map<String, ...
1
vote
1answer
277 views

Get field API Name of dependent field if picklist has dependency

Is there a way to retrieve via Schema.DescribeFieldResult field that sets dependency on picklist fields that have isDependentPicklist() true? For example: If my field Field1__c (picklist) has a ...
0
votes
2answers
149 views

Prevent other fields which is part of managed package

Retrieve all fields for particular sObject it is working fine but then i insall app which is part of manage package also retrieving fields of manage package. how to prevent to retrieve. objects/...
1
vote
1answer
215 views

How to access Owner field using getDescribe().fields.getMap()

I have a below code to access owner field from sObject. Map <String, Schema.SObjectType > sObjects = Schema.getGlobalDescribe(); Schema.SObjectType targetType = sObjects.get('...
0
votes
0answers
286 views

Error: Incorrect parameter type for subscript. Expected Text, received SetValue

I get following error in my vf page: Error: Incorrect parameter type for subscript. Expected Text, received SetValue Please share some thoughts, below is snippet from my page. <apex:repeat ...
1
vote
1answer
231 views

WSDL2Apex not generating type info for class properties

I am using WSDL2Apex tool in FuseIT Explorer to generate Apex classes. After tweaking my wsdl file a bit in order to get it to parse with the tool, all the classes are generated properly with the SOAP ...
2
votes
1answer
181 views

Check all objects are available for Schema.describeSObjects()

I'm getting all the objects in an org withSchema.getGlobalDescribe() and then running a describe on the the list of all the names with Schema.describeSObjects(objs). This has been fine so far, but I'...