Tagged Questions

An sObject represents an object, such as an Account or Campaign. An sObject is the base object for all objects in Apex.

learn more… | top users | synonyms

0
votes
0answers
19 views

Problem passing Account object from VF page to Flow sObject Variable

I have a problem passing an Account object from a visualforce page to an sObject variable in a flow. Error: When I go to the url: ...
0
votes
2answers
40 views

building an sObject from a json string in VF page

How can I deserialize a JSON string into an sObject in a VF page? I don't want to use a controller so I'm looking for the right approach to do this on the client side only. Any ideas?
0
votes
1answer
15 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
28 views

How to create object by it's name?

I'm writing a REST service which calls external service. I want to write a test for my service. I came up with no possibility to mock this call as it's in managed package. I want to wrap this call ...
1
vote
2answers
33 views

How to get to which object the field has reference

I have a wrapper class which contain some Object name. Now I am looping through a base object and want to check is the base object have lookup to any of these object. But when I pick the describe of a ...
0
votes
2answers
22 views

How to find the relationship between objects in apex class

Hi I have a base object that is a main object and I do have some other objects which is coming dynamically. I need to find out the relationship between the objects in apex class. If there any way to ...
2
votes
1answer
31 views

How can I get all the object and fields from the org which are accessible to the login user only.

I am getting all the object and related fields from my org using public Map schemaMap = Schema.getGlobalDescribe(); Map fieldMap = schemaMap.get(objectName).getDescribe().fields.getMap(); ...
0
votes
1answer
48 views

Error: Read access denied for null

Does any one have any idea why I am getting this error when I try to save {!sobj.c} Error: Read access denied for null my code <apex:repeat value="{!wcls}" ...
2
votes
0answers
34 views

how to loop through a list of sObject and field on VF page

I have a list of sObject which get populated dynamically all the objects and the related fields. The list look like this on debug (Contact:{OtherCountry=, Division_Type__c=}, ...
1
vote
1answer
75 views

How to display a list of dynamic sObject on Visualforce page

I have a list of sObject which I have created dynamically. This is how the list is populated. (Contact:{OtherCountry=null, Division_Type__c=null}, Account:{AccountNumber=null}) I don't want to ...
0
votes
1answer
37 views

How to add fields dynamically to sObject

I have a map which contain sObject anf sObjectfields. Now am looping through the map and want to add the fields to the list for eg: account.Name, conatct.Name, contact.type__c. And after that need ...
1
vote
1answer
41 views

Get SObject from Schema.SObjectType

I am getting all objects and fields now I need to add the object and field to a map where map is public List sObjectFieldLst = new List(); How can add the values to the map from ...
0
votes
1answer
34 views

How to covert a string to sObjectType

I have a object A where I am saving the name of the object as Strings and the fields also as String. Eg: If I have object Account, contact and opp objects. I am saving object Account as object Name ...
3
votes
1answer
51 views

How to get the information of a user who deleted an object?

Salesforce REST API supports the getdeleted endpoints to furnish a list of deleted records for an SObject. The response from the API looks like this { "deletedRecords" : [ { "id" : ...
2
votes
1answer
42 views

How to get recentlyviewed objects for all users?

Salesforce REST APIs support endpoints for getting updated, deleted and recentlyviewed objects. I am interested in getting the recentlyviewed items. This endpoint returns data of the form { ...
0
votes
0answers
44 views

SObject deployment: Cannot specify a startsWith attribute for this language

I'm trying to deploy an sobject to a new empty environment. I get the following error: Cannot specify a startsWith attribute for this language Both orgs are in English. Any thoughts? Edit: The ...
10
votes
4answers
527 views

Howto wildcard SELECT * to query all fields of objects in APEX?

I have created sObject and I need all the fields and I have many. Is there a way I can directly get all of them rather then typing each one of them.
2
votes
1answer
48 views

Compile Error: sObject type 'Custom__c' is not supported in Managed Package

I'm creating an apex class that implements Schedulable and in the execute it queries a Custom Object but I can't understand why I'm getting this error when trying to query. Some other related ...
0
votes
1answer
39 views

convert string to sObjectfield type

I have a custom setting where I have fields api name and getting the field api name and use with sObject. At that time I am getting error cannot use string with the sObject. How can I convert the ...
1
vote
3answers
93 views

Pass result of SOQL query into a variable

I have the following query: public List<My_Main_Object__c> data; data = [Select My_Object__r.Id FROM My_Main_Object__c where id=:XXXX]; How can I pass the result of this query into a ...
1
vote
2answers
41 views

How to prevent refreshes from blowing out sobjects and tables

I have created an sobject the essentially manages a callback URL to app servers we have running in-house: http://devmyapp01.example.com http://qamyapp01.example.com http://myapp01.example.com ...
0
votes
1answer
50 views

Cross-objects workflow with scenario

Can any body here explain me what is cross object workflow and how can we use it, what is the scenario where we can apply this.
1
vote
1answer
140 views

Insert multiple SObject data in Salesforce as single transaction using REST calls

I am using following soObject call to insert new row in the Account table at Salesforce server : curl -H "Authorization:OAuth use your session_id" -H "Content-Type: application/json" -d @Test.json ...
2
votes
1answer
19 views

getting layout of user using API

I am using this link to get the layout. I am using a REST client, Here is my request https://ap1.salesforce.com/services/data/v28.0/sobjects/Global/describe/layouts/ Authorization: Bearer ...
3
votes
1answer
39 views

problem with sObject as parameter

I get the below error when I try saving CLASS 1 below. The second class that is the problem is also below. I obviously don't understand objects or apex well, so any help would be greatly appreciated. ...
5
votes
2answers
141 views

SObject constructor signature?

when instantiating an SObject type, I can set initial field values by passing them to the constructor. For example like this: Account a = new Account(name = 'Acme', billingcity = 'San Francisco'); ...
0
votes
1answer
45 views

Illegal assignment from list<event> to sobject. Please help me in modifying the code

I'm writing a trigger to update the activity field-contact_sys_id__C with the value of sys id /siebel id depending on the if type field. trigger ContactSysID on Event (before insert) { ID evid; ...
3
votes
1answer
108 views

Get SObject by Id

I have an Id and I want to know if it's possible to get the SObject with this unique ID ? Something like : SObject object = getSObjectById(myId); I didn't find a method allowing that !
3
votes
1answer
87 views

How can I get the opportunity owner label?

Simple question. How can I get the opportunity owner label name? I tried the following code but it isn't working. An error occurred. {!$ObjectType.Opportunity.fields.Owner.label} I cannot use the ...
6
votes
2answers
174 views

Set Contains method is not working correctly after overriding equals() and hashcode() methods

I have created one class name like Test and have overriden its equals() and hashcode() methods and then created its 2 objects like below - Test obj1 = new Test (); Test obj2 = new Test (); and now ...
0
votes
1answer
231 views

how to get owner name, record type name, Account name on trigger of Contact

I'm writing custom history tracking code, tracking needs to be done for more than 50 fields All working fine, but instead of record type name , I'm getting record type id, and the same is happening ...
1
vote
1answer
45 views

Get one value from a list as an integer

I am having trouble updating a variable because of various errors. I cannot get the value from my list to work with the value of my other list. trigger StudentNoUpdate on Class_Size__c (before ...
1
vote
1answer
62 views

Create dropdown list of pricebooks

I'm in the process of creating a variable dependent picklist, where you can select a pricebook from a dropdown and then a multiselect picklist will show the products in that pricebook. So far, I have ...
0
votes
0answers
60 views

User Record Access on Account Team Member

I'm using the User Record Access object to check a user's permissions when it comes to editing/reading the Account Team Member object, but it seems like it is always false for both hasEditAccess and ...
4
votes
1answer
507 views

Using a generic SObject in VisualForce Page

I have a wrapper class that I want to reuse for Both Accounts and Contacts public class SelectableSObject{ public Boolean selected {get; set;} public SObject obj {get; set;} } In the ...
2
votes
1answer
108 views

How can I dynamically transverse dynamically SOQL'd SObject fields in Apex?

So, in my other post, I figured out for myself how to dynamically transverse SObject fields in Apex. But within the context of my work, there is a problem with the solution as it currently stands: ...
1
vote
0answers
45 views

ExactTarget Landing Page form - getting a ExactTarget error message if two non-required fields are empty

I have an ExactTarget Landing page form that create a SF Lead when submitted. If every field is filled out(approx 20 fields) everything passes into SF with no issue. The problem is this - of the ...
1
vote
1answer
57 views

Is it possible to use SObject Formula fields to get arbitrary values stored in some other SObject?

Let's say I have some SObject (myCode__c) with three string values (e.g. key1__c, key2__c, and code__c). The combination of key1__c and key2__c should be unique. Let's say I have a second SObject ...
4
votes
1answer
99 views

How can I dynamically transverse SObject fields in Apex?

I am trying to dynamically create a CSV file from Case records. The fields for the CSV file will be determined in custom settings (and therefore shouldn't be hardcoded). Moreover, the fields may ...
2
votes
1answer
1k views

apex:inputField can only be used with sObjects

I am trying to create a custom visualforce page that saves new opportunity contact roles to an opportunity. I am having trouble creating the first step of listing out all contacts that relate to that ...
1
vote
2answers
42 views

Can I tell if I queried a field?

I have some code that queries some fields from an object. I then use the schema to loop over all of the fields of an object. Is there a way, while I'm looping through the schema to tell if I had ...
1
vote
3answers
56 views

SOQL - Listing out down columns of a SObject

In Oracle, I can issue the following command to get me the table structure and list down all the columns of a table. desc table_name TABLE COL1 <DATA TYPE> <NOT NULL ETC> COL2 ...
3
votes
1answer
76 views

Issues with a Query within the main Query using DatabaseDotcom Ruby gem

I'm having a issue with pulling the data out of what would be a array of object data in my SFDC query. Im using the databasedotcom gem. Code def self.data_query #@client is defined at a class ...
0
votes
0answers
41 views

Partner Users cannot access User lookups

We have a situation with our partner users such that SFDC doesn’t allow partner users to access user records in user lookup fields on the opportunity. The affect is that they are unable to ...
8
votes
1answer
928 views

Finding a Custom Object Id (01I…) to get the Setup page URL

I'm trying to find a way to get the "Id" for a custom object's setup page. So I'm NOT trying get a record Id. I'm working on a custom visualforce page and I'm setting up a link so that when the user ...
1
vote
1answer
31 views

What is the best way to add to an apex collection of String

Is there a more efficient way to Select data into a String collection e.g. Set<String> than using a for loop Set<String> allTopicSet = new Set<String>(); for (Topic t: [select ...
2
votes
2answers
171 views

Can I set sobject id in a method?

Apex code developers guide says "The ID of an sObject is a read-only value and can never be modified explicitly in Apex unless it is cleared during a clone operation, or is assigned with a ...
2
votes
0answers
56 views

sObject insert execution not synchronous

I have a custom object and a controller action that creates a new record of this type. The action then returns a page where the list of objects are displayed. save() { ... insert myObject; ...
1
vote
2answers
291 views

Change the field of another object before insert

I have two Objects : Activities and Services, with each field. I create a Trigger (Before Insert) on the Activity, in the Trigger I would like to modify the fields of a record of the Service object. ...
3
votes
1answer
65 views

Can a Web Tab's url be get and set from Apex or the REST Api?

I would like to modify the url of my Web Tab for each SF organization that my managed package is installed on. Is there a way to get and set the url of a Web Tab from Apex or the REST Api? Is there a ...