Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
23 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
19 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
78 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
51 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
30 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
19 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
40 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
18 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
28 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
86 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
56 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
41 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
38 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
195 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
349 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
43 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
31 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 ...
2
votes
1answer
117 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
79 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
52 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
135 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
259 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
357 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
69 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
24 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
166 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
134 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
303 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
113 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
36 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
128 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
128 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
57 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
423 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
114 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
30 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
138 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
393 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
28 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('...
1
vote
2answers
2k 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
494 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 ...
0
votes
2answers
317 views

Need to filter only lookup/master-detail kind of fields from the entire fields on an object

I am querying all the fields on the Lead object and displaying them as a picklist on a visualforce page. I do not want the Lookup/Master-detail relationship fields to be displayed, though. For ...
7
votes
1answer
186 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
55 views

Need to display field labels in an alphabetical order

I am displaying all the fields of an object in a picklist. I am fetching the same using the Schema.SObject class. But, I want to display the labels in the picklist in an alphabetical order. Is there ...
1
vote
1answer
841 views

Want to fetch the child relationship name from the Lookup field name?

I am developing a functionality where I am to check for the presence of Child records, before executing a part of code. I can't do hardcoding since my code is going to be a part of a managed package, ...
0
votes
1answer
45 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
0answers
88 views

System fields in JSON request body

I am preparing dynamic JSON request body for the contact object fields using Schema.getGlobalDescribe class, but i am getting all the system fields in the request body like CreatedDate, IsDeleted, ...
3
votes
2answers
415 views

Does getPicklistValues() always return PicklistEntry records in proper order? [duplicate]

If I run DescribeFieldResult.getPicklistValues(), e.g., Contact.Salutation.getDescribe().getPicklistValues(), it usually returns the PicklistEntry records for Salutation in the order that I have ...
1
vote
3answers
159 views

Getting only phone fields name of a particular object

Getting only phone fields name of a particular object. I am using Js remoting technique in my visualforce page. How to get only the fields that are of type Phone?