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

1
vote
1answer
9 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
25 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
18 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
81 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
15 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
33 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
184 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
37 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
44 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
35 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: ...
2
votes
1answer
26 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
57 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
84 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
99 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" ...
0
votes
1answer
68 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
45 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 ...
3
votes
1answer
35 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
77 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
149 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
29 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 ...
2
votes
3answers
72 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
49 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
34 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
64 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
109 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
39 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
171 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
33 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 ...
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
166 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 = ...
1
vote
1answer
49 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
55 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
81 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
70 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
54 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
186 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
37 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 ...
0
votes
0answers
15 views

Alternative way of finding the Report type

I need a little help with Reports. I get the report metadata in JSON, but the returned reportType is not meaningful enough to me so I can tell for sure for which Objects is the report. Here's sample ...
2
votes
2answers
151 views

Get all Button who have used JavaScript

Is there any way to find out all the Button in org who have used JavaScript in it. Or Lets make it more simple - How can I get List of all Button in sObject. (Where also I can differentiate ...
0
votes
0answers
39 views

Updating Existing Records in Flow

I have what seems to be a simple issue but I cannot solve it. Here's the scenario: A custom record "Buildings" is created - this is via an import but not relevant to my Q. Once the record is created ...
2
votes
1answer
41 views

Is that possible to write dynamic code for Salesforce SOAP to use object like map?

For regular SObject, I can run the following code: static void x(Map<String, String> fieldValuesMap) { SObject so; for (String key: fieldValuesMap.keySet() ) { so.put( key, ...
4
votes
1answer
149 views

How to see the entire resultset in the debug log instead of (n more)?

Good Morning, Thanks in advance for reading. Is there any way to display the whole sObject in the resultset returned by SOQL query instead of the (n more) below e.g. 30 more, 22 more etc. ? I am ...
2
votes
1answer
69 views

How to use a Dynamic List Type of SObject getted by ID

I'm trying to do a Dynamic List of a SObject gutted from an ID. My goal is SEND a SObject info via mail. (Opportunity, Case...) From a list of selected records, I send by argument their IDs with ...
0
votes
1answer
57 views

How to add SObject to an SObject Collection in Visual Flow

I have a flow that loops through a few collections and eventually brings me to a point where I have assigned an SObject a set of variables. Then I want to add that SObject to a new collection for fast ...
0
votes
2answers
94 views

Unit Test Fail - list has no rows for assignment to Sobject

Good Afternoon, I am running my test class and i am getting the following error message. Class.DM_MarketingCloudPolicyController.getPolicy: line 43, column 1 ...