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

learn more… | top users | synonyms

1
vote
1answer
30 views

What all is in Schema.getGlobalDescribe()? [closed]

what all is returned in that call? i tried debugging it but it was truncated. Does it tell you for example the names of all your apex classes, VF pages, layouts, recordtypes etc?
7
votes
4answers
261 views

How to identify look up relations to an object in Salesforce

I have a custom object and I would like to know which all other objects have look up relations to this one? There are many objects available and I cannot go into each and identify which would have ...
0
votes
2answers
35 views

How to get Object Label

I have object's API Name How can I get Object's Label ? I am trying this Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Schema.SObjectType schemaObj = schemaMap.get(...
1
vote
1answer
25 views

Export Custom Object Schema

I am building an app exchange app and I want to transfer orders into a custom Salesforce object called invoice. How can I export the custom object, without any data, into another user's Salesforce? I ...
1
vote
1answer
50 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 ...
2
votes
1answer
39 views

Schema.SObjectField inconsistency with relationship fields

I was trying to build a utility wherein I could pass in a literal field token for a relationship field and discovered an inconsistency This works (going from Contacts -> Account) Schema.SObjectField ...
0
votes
1answer
25 views

Schema Builder export (OS)

Is there anyway to export the Schema builder to get an accurate depiction of the data model in a PDF or any format? I've looked online, and I haven't been able to come up with any alternatives because ...
1
vote
1answer
43 views

schema.describefieldresult how to cover when i pass field name and objecet name occur Compile Error: Variable does not exist: Contact

class part public static Schema.DescribeFieldResult gettingDataType(String fieldName,ObjectType oType){ Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get(...
1
vote
1answer
26 views

I am retriving all the object using getGlobalDescribe how can i add that list to a picklist?

public class dynamicSoqlController { public List<Schema.SObjectType> globalSchemaList = new List<Schema.SObjectType>(); public List<Schema.SObjectType> getGlobalDescride() ...
1
vote
1answer
39 views

Page Layouts inside Visualforce page

I am creating a page that let's me create multiple objects at once. The thing is that I want it to be dynamic so that an admin can modify it simply by changing the standard page layouts to make new ...
0
votes
1answer
69 views

How do I get default field value of an object?

When I try the following: Object defaultValue = MyObject__c.MyField__c.getDescribe().getDefaultValue(); Object defaultValue = MyObject__c.SObject.MyField__c.getDescribe().getDefaultValue(); I ...
3
votes
1answer
24 views

Are Sharing Settings of Relationship fields retrievable by Schema or Metadata/Tooling API?

Is there a way to find out in Apex code if on of the two radio options is set in an Org?
3
votes
1answer
36 views

Problems with using apex to get metadata

1.When I query the objects using Schema.getGlobalDescribe() I get wierd objects like "ApexTestQueueItem", "Announcement", "AccountContactRole", "Account_Escalation__c". I basically only want the ...
4
votes
1answer
46 views

Schema object name check results differ between managed package and a non-packaged code

I've created a function that determines if an object is real and (in this case) setting a variable to true/false based in that result. That value is then used to set a vf variable that will later be ...
1
vote
1answer
157 views

How can I create an Account Note or Contact Note via API that is visible in Salesforce UI?

I am using the python simple-salesforce library. Steps to reproduce. Create an Account: sf.Account.create({'Name':'Testy Account','AccountNumber':'123456'}) Query the Id of your new Account: sf....
0
votes
1answer
41 views

how to fetch the picklist and field values dynamically from multiple objects [duplicate]

public class PickListController { global static list<SelectOption> getPicklistValues ('Employee__c' , 'Priority__c') { list<SelectOption> options = new list<SelectOption>(); ...
0
votes
0answers
18 views

Two Object with Same Schema - Effects of Actions on each other

I am asking this question for the curiosity ? I came across following Interview Question asked to someone - Q: "I have two identical objects with same schema. If I want any action performed on any ...
0
votes
0answers
47 views

Real Estate: Asset, Product or Custom?

We're designing our schema now and are trying to stay as Salesforce standard as possible. We're a mortgage lending company, so our clients typically look to us to refinance their property debt. Use ...
1
vote
2answers
46 views

What's the best way to store many small reference tables in Salesforce?

Our iOS application gathers information about referrals. There are many pick-lists in the application which present several options. Some are single select, some are multi-select. The values change ...
1
vote
0answers
58 views

Best practice for custom fields added to standard objects in Managed Package

We have a requirement wherein we need to have certain custom attributes in the Account object within our Managed Package being deployed onto an existing SFDC set up. These attributes are readable and ...
0
votes
1answer
88 views

Dynamic Apex: find relations between sObjectTypes

I am trying to create a class that can dynamically execute its function independent of the sObjects and sObjectTypes provided. The class should check, wheter the sObjects provided do have existing ...
0
votes
1answer
80 views

How to check access of user for particular user on object

How do I check the access of current user on particular object dynamically. I have a custom mapping object in that I am storing object name in the string. I want to check Whether the current user has ...
0
votes
1answer
204 views

Incompatible value type id for Map error

Anyone know why this keeps throwing an error? list<Account>Dealerships = new list<Account>(); map<Id, OpportunityLineItem> Opp2Deal = new map<Id, OpportunityLineItem>(); ...
3
votes
1answer
86 views

How to use soql queries on multiple look up relationship object to retrieve specific data

I have 4 custom objects (as shown in the schema diagram). And they are associated using a lookup relationship. Now the objective of my question is to retrieve Product profile(product) for a given ...
9
votes
1answer
112 views

What's the pattern for Platform Encryption field mask length?

I've enabled Platform Encryption on standard Account and Contact fields, as well as on custom fields. In general masked field values are displayed as 5 asterisks (*****), but there are some exceptions:...
0
votes
1answer
832 views

get picklist values of custom field into customButton javascript

Is it possible to populate the custom field picklist values into a custom button javascript code? Any pointers on how to use Schema.DescribeFieldResult class in javascript? I am actually working on a ...
5
votes
2answers
177 views

How to differentiate LIST apart from HIERARCHY setting in Apex?

My Apex code needs to dynamically reflect on user-defined Custom Settings. But the user could use a List or Hierarchy depending on their needs, so I need to be a bit careful manipulating each type. ...
1
vote
2answers
60 views

Contact object access check fails in Group Edition

This piece of code returns FALSE in a Group edition organization owned by a customer, and I'm unable to figure out why. When tried in a brand new GE org provisioned via EnvHub, it works properly. ...
2
votes
2answers
103 views

Different results for Schema information in different classes - why?

I'm experiencing a very odd behaviour in my SF org. I have two classes that have an identical method: /* works */ public with sharing class classA { public static void getFieldDescriptions(...
4
votes
1answer
179 views

How to check if an object has recordtypes specified or not?

I want to find a way how can I check if a type of object, has any record types specified or not. I tried, with the describe methods, by acquiring a List, according to the SObjectType, but this doesn'...
-1
votes
1answer
142 views

How to get a list of SObjects which have self lookup field on them USING schema class

public with sharing class listOfAccounts { public list<Schema.SObjectType> gl {get; set;} public list<string> listOfObjects {get; set;} public listOfAccounts() { ...
1
vote
1answer
23 views

CaseTeamMember not returned as a Child

When getting schema info for objects related to cases Case Team Member does not show up. Case Team Member has a lookup to Case so I would think the relationship would work. Does anyone know why this ...
3
votes
1answer
922 views

Schema fields getMap() doesn't return all the fields

I'm using Schema to retreive the fields and put them in a map that I can use in my Visualforce page. public Map<String,String> m1{get;set;} public List<String> fieldsList {get; set;} ...
3
votes
1answer
367 views

Custom Object Prefix in URL Hacking Using Custom Button

This question is inspired by this Post. Can anyone enlighten me more about "object prepend" mentioned in this post. So in an example URL like https://na10.salesforce.com/a0B/e?CF00NA0000005JzZX=...
1
vote
0answers
40 views

getDescribe() of an External Object throws NPE

I have a external object called "TD_Account__x" whose label is "TD Account". I am trying to do a describe call on "TD_Account__x" and it throws me NPE. Execute anonymous code - System.debug('@@ ==&...
0
votes
2answers
1k views

How to get Standard and Custom Object List in Apex class

I am trying to get all Standard and Custom Objects name from Schema class in apex class. I need to remove all shared objects from the list.
1
vote
2answers
338 views

RecordType DeveloperName dynamically using scehma.getGlobalDescribe

Hi I need to access recordtype details for case Object using DeveloperName. Is there any way I can get complete record type details using schema.getGlobalDescribe method? Or is there any other way to ...
6
votes
1answer
178 views

Standard field accessiblity inconsistent : feature or simply strange?

UPDATE: Thanks to @ca_peterson I could clarify the issue below and it all drills down to FLS. But even having identified FLS as the reason, the behavior is still odd and I have addressed it in this ...
3
votes
1answer
528 views

How to get a DescribeFieldResult from a FieldSetMember?

Fieldsets can reference fields in related objects, something like Opportunity.Account.Name. If you iterate over such FieldSetMembers on a Visualforce page and try to render a fields inline help text ...
0
votes
1answer
77 views

Attempt to de-reference a null object: Error though have data

I am getting the subject error for below piece of code , exactly at below line. Though I have data in call object.Can someone please let me know the root cause and guide towards it's remedy? error ...
0
votes
0answers
250 views

Attempt to de-reference a null object error in my apex class

I got Attempt to de-reference a null object error in my apex class.. We have to execute the fallowing code by schema... ANY ONE CAN HELP ME REGARDING THIS.... Here is my vf page and apex class.. ...
8
votes
1answer
841 views

How to list down all Standard/Custom Objects and ignore System(Internal) Objects

There's always a requirement to pull ALL standard and custom objects using describe call ignoring all system/internal objects. Is there a way for same? One of option is to reference ProcessInstance ...
1
vote
2answers
366 views

Get Created Date of Custom Objects in Visual Force page

I want to get the created date of all the custom objects present in my Org.
0
votes
0answers
149 views

Insufficient Privileges on button click

I have a class in with Schema.getGlobalDescribe() getting all the object and all the information related to it. On the page load it is not giving any error I can see the filed related to all ...
4
votes
4answers
4k views

How can I export object's field schema information to excel?

How can I export the fields of an object from Salesforce into an Excel sheet ? I dont want the data !! I want the fields, kindly help me
1
vote
1answer
277 views

How to use Data Category Visibility in a data category picklist that generated from code

Problem description: I have a picklist for data categories which I am generating dynamically from apex code, currently because I'm doing it from code using Schema.describeDataCategoryGroups and ...
0
votes
1answer
67 views

Custom object schema visibility

We are planning a managed application for Salesforce platform and there are few things that are hazy. Lets say if a customer install our managed application in their organization will they be able ...
2
votes
1answer
301 views

what does retrievable and replicable access meant for an object in salesforce schema?

From the access level for an object in salesforce schema i understood queryable, deletable and creatable, but what does retrievable and replicable access meant for an object in salesforce schema? ...
22
votes
4answers
7k views

How to get the Runtime-Type of an Object dynamically (for Primitive Data Types and SObjects)

Is it possible to get the Type of an Object (it's not an SObject)? String s = 'test'; doSomething(s); public static void doSomething(o Object) { // need to find out if o is a string or an ...
2
votes
1answer
959 views

Get Schema.SObjectField from Schema.FieldSetMember

I couldn't find any elegant (no use of Strings) to create a Schema.SObjectField from a Schema.FieldSetMember. Can you think of one?! The reason for asking this is that I was also unable to get the ...