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

2
votes
3answers
41 views

Invalid field for SObject using nested SOQL Query

Trying to create a list of Open activities so that I can sort and display as an apexDataTable on a VF page. I'm currently seeing the error: Invalid field Subject for SObject Account VF Page ...
0
votes
1answer
19 views

Not able to undelete Attachments

I have written a trigger on Attachment. Events are after insert, update, delete and undelete. But I noticed that the undelete trigger doesn't fire at all. I tried to undelete from recycle bin. Even ...
0
votes
1answer
16 views

Compile Error: Initial term of field expression must be a concrete SObject: String

this is checkbox S1SD1__c public static void moveStageBackward(Opportunity opp, Opportunity oldOpp, String newStage, String oldStage){ Map<String, Schema.SObjectField> objectFieldMap = ...
1
vote
1answer
32 views

Passing Sobject to apex rest method using JSON

I am exploring a way to pass a sobject to an apex class. Below is my apex class: @RestResource(urlMapping = '/resturl/*') global with sharing class check { public boolean Hide { get; ...
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(...
7
votes
0answers
39 views

“System.SObjectException: Contact.AccountId does not belong to SObject type Contact” error often in Summer '16

We are seeing a test failure in a couple of our Continuous Integration builds (that deploy the same code) with the error: System.SObjectException: Contact.AccountId does not belong to SObject ...
1
vote
0answers
17 views

How to create relation between a custom object and Products Line Item ? (Same as Quotes & Quote Line Item)

I was looking for a clean approach where I can apply multiple Products' to a Proposal(Estimate). Would need to be able to add an unknown number of Products to the Proposal(Estimate), along with ...
1
vote
2answers
39 views

Rendering Array of Custom Objects in Component

I have a custom visualforce component with a controller, it takes an attribute of an Id of a related record, and in the controller I query for the set of objects I want to display. When I attempt to ...
1
vote
1answer
10 views

Quote Trigger Initial term of field expression must be a concrete SObject: Boolean at line 32 column 89

I can't seem to figure my issue here on the code below. Originally I had Opportunity__c and was getting a invalid field error. I replaced Opportunity__c with the OpportunityId field and received the ...
0
votes
0answers
29 views

External id field is not populating when cloning a sobject record

I have used object.clone() here and then changed some field values. All the changes are reflected in the cloned record except not able to populate External Id field which is concatenation of two Id ...
0
votes
2answers
21 views

Overwrite an SObject with another SObject without losing related records

In Apex is there an efficient way to overwrite an SObject instance with another SObject (both of the same type) without losing parent and children records? In the following example I want to replace ...
1
vote
2answers
140 views

Get url into lightning component - Redirection to an object record

I have a lightning component in which I wnat to make a link that redirect to an object record : <aura:iteration var="a" items="{!v.actualites}"> <a href="{! a.Id}" data-id="{!a.Id}" ...
0
votes
0answers
18 views

Query and Update Profile Object Permissions and Tab Settings

Is it possible to query Profile Object Permissions and Tab Settings? I prefer to not use AppExchange products for this, yes I am anti AppExchange. I see there is an ObjectPermissions sObject, but ...
0
votes
1answer
52 views

SFDC Advanced Visual workflow loop optimization

I am trying to do a conditional, multi-level deep clone based on a hierarchy of template records. The conditional part means that if the target record exists, then I do not update/overwrite it. I ...
3
votes
1answer
205 views

Get all Parent and child objects related to the current object

I have a string which contain the name of a sobject. Now I want to get all the objects related to this object. Also want to get which kind of relationship it have with these object.
1
vote
1answer
39 views

Get fields from custom object

I have a string which is a name of sObject. I converted the string to a sObject. Now I want to get the fields from the object. When I try to access the fields from sobject (contact) i am getting error ...
1
vote
0answers
53 views

RemoteAction: problem returning Map<object, sObject>

I am trying to return a map of object to sobject. However I get a parsing error: VFRemote.js:117 Visualforce Remoting Exception: Error parsing json response: 'Unexpected token {'. Logged ...
0
votes
1answer
38 views

Problem passing a list of sObjects from apex to JavaScript

In apex I retrieve a list of sObjects and store them in a list. So it looks like this: public static List<sObject> listOfSobjects {get;set;} And then I query for this sobject from the db: ...
1
vote
1answer
28 views

Problem populating a list of children related to a queried sObject

I have sObject1 called sObject1__c which is a parent(master-detail) to many sObjects2 each called sObject2__c. So in my trigger I have an empty list of sObject2 related to sObject1: sObject1__c....
2
votes
1answer
27 views

Is it possible to assign a field value as a key for a Map query

I am wondering if it's possible to create something similar to this: Map<sObject.field, sObject> mapOfsObject = new Map<sObject.field, sObject> ([ SELECT field FROM sObject ]); I ...
2
votes
1answer
68 views

Which Objects are displayed in PermissionSet Object Settings?

I am a noob with Salesforce, please bare with my question. I am creating an App which enables easy edit/creation of PermissionSets on an ORG. In this process, I am creating a tree view with ...
3
votes
2answers
87 views

Do email results come in the same order as the list of emails

I populate a list of emails emailsToBeSent and send them all at once. However These emails are related to different sObjects. And to me it is important to know which sObject the returned results are ...
0
votes
0answers
13 views

Query Resources in Resources [duplicate]

Is there any way I can query the Resources in Public Calendars and Resources? There does not seem to be any object related to the resources so if someone could help me out, it'd be great!
3
votes
2answers
113 views

Remote Objects: Insert an array of objects

Is it possible to insert an array of objects using Remote Object Model? Here's my code: <apex:remoteObjects jsNamespace="romodel"> <apex:remoteObjectModel name="Stock__c" jsShorthand="...
0
votes
1answer
74 views

unable to convert parameter to apex type got arraylist [duplicate]

Is there a way to pass a sObject with RemoteAction from JavaScript to Apex? I want to create a bunch of sObjects. What is the right way to pass their information from JS to Apex with RemoteAction? ...
0
votes
2answers
47 views

Unable to retieve dynamic sObject field value

Trying to retrieve value of field from any given query on sobject. But when i have to traverse across multiple objects to fetch the value, I am not getting expected result. Ex: to get value of owner....
3
votes
1answer
48 views

Query for 'Lead' object is not returning a Converted Account ID

I am using the following JSforce command to get a specific lead: jsobject('Lead').find({ Phone:number})... The problem that I am running into is that I am getting data returned, but it seems to be ...
2
votes
3answers
88 views

Iterate over queried lookup fields

Example: Opportunity Opp = [SELECT Name, Status__c, Zone__c, Invoice__r.Amount__c, Invoice__r.Date__c FROM Opportunity WHERE ID ='006a12nlfoenlew']; I need to iterate over each field and see if ...
0
votes
1answer
222 views

Compatible Schema.DisplayType For SObject Put

I'm trying to write a method for working with sObject.put(field, value) statements in a loop where the Schema.DisplayType of the fields received varies. The goal is to have the method return the name ...
0
votes
1answer
31 views

N>Help with Passing Values from one Object picklist to another Object text

I have 3 objects Contact, mList and mEvent. mList is a junction object which has master-detail relationships to both Contact and mEvent. The mEvent has a picklist field called Group_Level__c (values 1,...
2
votes
3answers
87 views

Convert SObjects containing child/parent records into a map

How can the following list of records be serialized/deserialized into a map or collection? Account[] accs = [select id, name, custom_parent__r.name, (select lastname, firstname from Contacts) from ...
3
votes
1answer
53 views

repeat inputfields dynamic dependent on list of string

I have an sObject custom_obj__c with a multi-select picklist field items_list__c and its values (items) are (item1 list, item2 list, item3 list,..), and checkbox fields (item1_list__c, item2_list__c, ...
0
votes
1answer
49 views

Compile Error: Constructor not defined: [ApexPages.StandardController].<Constructor>(List<Partner__c>)

I'm trying to write an apex test class for my apex (extension) of my visualforce page which display list of partners from partner__c sObject and do some actions on its rows like edit and delete. ...
0
votes
4answers
72 views

Displaying Related List on Custom Object: SObject row was retrieved via SOQL without querying the requested field

Any help would be greatly appreciated (either in actual code help or pointing me in the right direction). I'm not much of a developer but was trying to get a related list from a custom object to ...
0
votes
0answers
32 views

Help with class and VisualForce page (sObjects)

Hi I have a seemingly complex requirement regarding multiple sObjects and a VisualForce page. Requirement: There are 3 custom objects ItsApproved_Booking__c (related to the Opportunity object) ...
3
votes
0answers
125 views

Bad rightOperand type: got SObjectScriptRow

I just want to know what is SObjectScriptRow! All I can find about it is this question. I'm building an invocable method to be used from a process, where I have one input parameter: a list of an ...
2
votes
1answer
42 views

Dynamic Schema getDescribe

I have two variables: public String selectedObject {get; set;} //selectlist public String selectedField {get; set;} //selectlist public String selectedDataType {get; set;} //text They are the ...
3
votes
2answers
240 views

Cast a Map <Id, sObject> to Map <Id, Opportunity>

I'm trying to implement the trigger framework outlined here: The triggerhandler methods take lists or maps of sObjects as their inputs. In his example he casts list <sObject> as list <...
3
votes
1answer
35 views

Get a deleted record using SObject Rows returns “The requested resource does not exist”

I'm using the SObject Rows API to get the fields values of a given record. It works fine on existing records but when used on deleted records it returns with an error of {"errorCode":"NOT_FOUND","...
0
votes
0answers
22 views

Trigger Invite email when creating new users through REST API

I am new to salesforce development. I have successfully implemented salesforce REST API and was able to create a new user. However user is not getting invite email. I have gone through several ...
0
votes
0answers
23 views

Anonymous behavior custom object access field change

There is a trigger that will create a Case Comment (custom object case comment record) if a custom object record is created and it works fine. But what happens is when a record status is changed ...
10
votes
2answers
173 views

Case-Insensitive Maps?

How is it that describes seem to return case-insensitive maps? For instance, if I create a new custom setting, the following succeeds: Map<String, SObjectField> fields1 = SObjectType....
1
vote
1answer
57 views

How to update reference field in sobject

I'm trying to update a sobject (CollaborationGroupFeed) via apex, but I am unable to update a particular reference field (in this case: CreatedBy). Here is my code: CollaborationGroupFeed cgf = [...
1
vote
2answers
36 views

Dynamic formula field

How can i use dynamic field value in the formula field. Like :- TEXT(contact__r.Contact_Title__c) I want to deploy this formula field in my org without creating Contact_Title__c field on contact ...
0
votes
1answer
65 views

Value an object with a map<String field, String value>

I am developing an apex code to scan an email and use some values i can found. I have a custom object used to map the labels to existing fields. Then i have a map with field names and values. I would ...
0
votes
1answer
96 views

How to assign an Account Name on an Opportunity Test Class

I am creating a @testClass for an Apex Trigger I wrote with the intent to automatically set an Opportunity Checkbox field to False, if the Opportunity was cloned. (The Else statement also defaults the ...
0
votes
1answer
88 views

Retrieve the records as a picklist when an SObject is selected from another picklist

I have a requirement where I need to display all the SObjects as a picklist. When the SObject is selected, another picklist having the name of the records of that particular SObject must be displayed. ...
2
votes
1answer
59 views

MiddleName Field cannot find in in “.fields.getMap()”

We've just enabled the Middle Name and Suffix Fields feature and encountered the below issue. SUMMERY : Just after enabling "Middle Name and Suffix Fields", Implementation of custom apex logic in a ...
1
vote
1answer
199 views

recalculateFormulas() causing UnexpectedException: Unable to create/update fields: IsDeleted

When I update my custom Record__c a trigger runs, and it calls recalculateFormulas() on the record. This results in the following error: System.UnexpectedException: Unable to create/update fields: ...
1
vote
1answer
42 views

What is the fastest way to update a field on thousands of records?

I need to create a new checkbox field on an SObject, and I would like the original value to be true. Setting the default value of the field to true only applies to new records. What is the fastest ...