We’re rewarding the question askers & reputations are being recalculated! Read more.

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
2answers
36 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
33 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
41 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 ...
1
vote
2answers
41 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
17 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
402 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
33 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
68 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
39 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
49 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 ...
2
votes
1answer
134 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
0answers
59 views

Pass By Reference: Field Update Not updating Properly When Using Schema Class

I have a class called UpdateContactOutreachStatus. The class gets the contact in the opportunity contact role and updates the contacts Outreach Status Field. Anyways, I have a class called ...
0
votes
4answers
58 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
23 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
103 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
23 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
76 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
144 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
91 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 ...
1
vote
1answer
58 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'...
0
votes
1answer
86 views

How to retrieve picklist option values in heroku

I am trying to get and display the picklist option from salesforce, in heroku. Can anyone kindly let me know how I can achieve this. I am querying records from case. And I want to display the case ...
8
votes
1answer
223 views

If I know the API Name, how can I get and work with the Schema.ChildRelationship?

Like many SFDC developers, we have SObjects which are related to other custom relationships. So, for example, MyCustomObject__c could have a relationship with MyCustomRelationship__c which in Apex we ...
1
vote
2answers
868 views

How do I get a dynamic list of object field names to present in a lightning duallistbox

I'm still relatively new to lightning and APEX, and I've read (it seems like) 100s of posts / examples of how to do this, because it seems like a lot of people ask this, but I cannot make it work. I ...
0
votes
1answer
83 views

Help with a schema, custom object to track product stock on Orders

How can I track product stock levels across locations? Our business process is basically this: When an oppy is closed won a trigger will automatically create a contract (not used by us - consider ...
4
votes
1answer
33 views

Territory2Id no longer visible to partner users?

Since Spring 19 release got pushed to our sandboxes, we've had a bunch of problems with the community we're working on. I've been debugging and seem to have isolated this issue. If I enter the ...
3
votes
1answer
172 views

schemaSpy 6.0.0 - generation ends up with Null Pointer Exception

Although I was able to generate docs using schemaSpy 5.0.0, I'm constantly having problems with version 6.0.0. Do we have anybody here who has gone through this successfully? Preconditions: ...
0
votes
1answer
172 views

Schema global describe map keyset

I have a doubt regarding the Schema.getGlobalDescribe() method which returns a Map.. I know that Schema.SobjectType is the Api names of Sobjects.. But I am not able to understand what does the keys of ...
0
votes
1answer
78 views

Search Value inside a picklist before inserting

I have objects that I need to fill from a web service that I get from some source. I wondering, If I want to check if a picklist value that transferred from this webservice is a valid value in the ...
2
votes
1answer
199 views

Mapped Picklist field values in a wrapper class in incorrect format

I want to retrieve the picklist values of all picklist fields from a standard object. Below part of the code //Wrapper class public class FieldMetaDataWrapper { @AuraEnabled public String ...
2
votes
1answer
456 views

Best practice using Schema.SObjectType

Wants to know please, 1) Why using the Schema.SObjectType is better than using a SOQL? 2) If using the Schema.SObjectType inside a for loop is a bad Idea... for example: Id devRecordTypeId = Schema....
2
votes
1answer
1k views

Is there a way to query exclusively the fields in the Page Layout for an sObject via APEX?

I've been looking in to the ui-api but it doesn't cut it for me, what I need It's to return exclusively the fields in the Page Layout for an object and some additional records. Something like ...
2
votes
2answers
180 views

What is the schema, the namespace and the Schema namespace

Can anyone help me understand what is the Schema, the namespace and consequently the Schema namespace ?
-1
votes
1answer
35 views

Need to get schema field of a object while process [closed]

I tried as below mentioned code, for adding field value in dynamic way String type='Object__c'; Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); //getting required custom ...
2
votes
0answers
27 views

Apex code to know if an ChildRelationship is in my package

I am working out of a managed package and want to find out what lookups are created by customers of my package. So fields that are unpackage. for(ChildRelationship rel : myType.getDescribe()....
0
votes
1answer
313 views

How to check if sObject/sObectType is supported in SOQL?

I'm working on a SOQL query builder which should show all the Objects of an Org which are supported in SOQL query. I've used Schema.getGlobalDescribe() to get all objects name. Though it returns all ...
0
votes
2answers
204 views

Issues with SchemaSpy

I am facing issues with Schemaspy when trying to connect with Production org. Below is the build.xml I am using - <project default="document"> <property name="sf.username" value="I PUT ...
2
votes
1answer
390 views

Translation for '--None--' value in lightning?

I am fetching the Labels & Values of a Picklist by using the following method public static Map<String,String> getPickListValuesMap(string objName, string fieldName){ Schema....
1
vote
1answer
119 views

move all child records from one account to another efficiently

I did a bit of searching and didn't come up with anything so apologies if this is a duplicate, but - Situation: I am looking for a way to migrate all related object records from one (bad) account ...
0
votes
1answer
37 views

Convert Objecttype for DML update

Trying to update a child object from a parent object using the Objecttype returned form a getReferenceTo() but getting errors as Method does not exist or incorrect signature: How can I convert the ...
1
vote
2answers
159 views

How can I identify whether a picklist allows free text dynamically?

When iterating through fields in an object using the Schema methods, I can identify whether a field is a picklist. How do I tell if this field allows input of free text? For example, Task.Subject is ...
1
vote
1answer
172 views

Schema Class throws exception after creating package

I am using Schema class to retrieve metadata of object. Controller : getCustomObject : function(cmp, event, helper) { var action = cmp.get("c.getCustomObject"); var objectName = component.get(...
6
votes
1answer
58 views

Is the API Version available for Standard Fields/Objects with which the fields/objects has been introduced?

I have written a SOQL-tool which allows me stuff like SELECT * FROM ... It is based on APEX Schema functions and works very good. It expands and compiles a full list of fields in a string, which I ...
0
votes
2answers
635 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 ...
0
votes
0answers
142 views

How to get a DescribeSObjectResult from a DescribeFieldResult [duplicate]

I have a function argument, dfr, that is of type Schema.DescribeFieldResult. Based off this variable, I need to find it's parent SObject and get the Describe Result for it (Schema....
0
votes
0answers
49 views

Can't view all attributes of an object in Schema builder

I'm currently trying to display all of the attributes that an object has so I can determine the appropriate field to use for what I need to do. When I click on the option "view object" on a schema in ...
1
vote
2answers
183 views

Null pointer exception in SchemaMap

I am trying to find whether a given field resides in a particular Sobject. I am using the code When I try to run this code, I am getting null pointer exception in line no. 3. I guess schemaMap ...
2
votes
3answers
726 views

To find Custom objects inside apex

I want to check whether a given object is standard or custom. At present I have a method which identifies custom objects but that is taking too much CPU time, which leads to salesforce exception. ...
2
votes
1answer
31 views

How to Remove Id Field and Some standard field in selectOption. I am add the field through schema class in apex

Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); List<SelectOption> options = new List<SelectOption>(); Schema.SObjectType leadSchema = schemaMap.get('...
3
votes
2answers
4k views

Get Picklist Values based on Record Type

Am designing a JQuery AutoComplete search box in visualforce page and getting the data source from controller class from two picklist fields(Controlling and dependent). The autocomplete search box ...
4
votes
1answer
843 views

Querying metadata - Find Custom fields created today

I am looking to find the "Custom" fields that were created "today" within an object in Salesforce.com. There are more than 500 fields on the object and the "Modified By" field in the schema is not ...