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
1answer
25 views

How to check that SObject field is present in SOQL query

When you try to attempt to the field that not present in SOQL query, you get error like that: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: ...
0
votes
1answer
32 views

Updating records before insertion from a custom object into a standard object

I am working on a project in "Developer Edition" of salesforce ... I want to create such mechanism so that whenever I create a record in a standard object , it would check a certain criteria ( custom ...
0
votes
0answers
33 views

Calculate distance between two locations [on hold]

I needed to calculate distance between two locations. I used "Clean Rules" to get the geo location of the distances.But, that clean rule thing is storing the latitude and locations in fields and ...
1
vote
0answers
11 views

How to size database columns for storing Salesforce fields; length or bytelength?

All fields in Salesforce have two lengths; a unicode character length and bytes length; our org uses UTF-8. We're sizing tables/columns in Oracle to accomodate our data from the cloud, my question is ...
1
vote
2answers
115 views

Can someone please explain what is meant by sObject?

I am very new to the Apex programming first.And I know about Standard & Custom objects. And also the the custom objects have an extension of '__c'. I observed in the programming lot of reference ...
2
votes
2answers
45 views

Embedded VF Page Not Responding To StandardController

I am trying to embed a custom VF page into my Accounts layout. I believe my error is in the standardController. I assumed it should be SObject but it did not work and now I am not 100% sure what it ...
0
votes
0answers
26 views

insufficient previlage Error showing when insert record from modal(popup) Dynamicly

public SObject SobjectNewRecord{get; set;} public void newRecord(){ Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); Schema.SobjectType oType = gd.get(...
2
votes
3answers
90 views

Why am I unable to pass an Opportunity from a Lightning Component into an @AuraEnabled Apex controller method?

I have a Lightning Component with an Opportunity attribute. The controller calls a helper method, which obtains the Opportunity from the component and attempts to pass it into Apex to be saved. I am ...
2
votes
3answers
46 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
18 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
41 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
62 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
20 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
43 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
30 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
22 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
232 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
61 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
228 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
46 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
61 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
43 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
31 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
74 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
121 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
79 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
50 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
60 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
93 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
265 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
115 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
65 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
76 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
136 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
47 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
289 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
38 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
24 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
184 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....