Questions tagged [sobject]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
139 views

Sobject Get on Relationship fields : Invalid Field [duplicate]

I am working on a module where I have to create complex nested JSON dynamically based upon configs stored in custom metadata, The metadata contains Object name, fields names as text fields. Now the ...
0
votes
2answers
61 views

RelatedTo field of Email message

RelatedTo field has multiple lookups to various object for my instance its heavily populated as follows: Lookup(Contract,Campaign,Organization,Donation,Product,Asset,Case,Solution,Asset ...
1
vote
1answer
478 views

Salesforce datetime field adding user timezone to the field

I have two datetime field in custom object, to which I am inserting values programatically from my apex class. Fields from my custom object My apex code used to insert/update records in the custom ...
0
votes
3answers
63 views

Retrieve object type via id using apex

I am new to Salesforce and trying to figure out the object type using the ID which I see in the URL on the Salesforce page. I found many places describing how to do this with the Apex language, such ...
2
votes
1answer
68 views

Iterate over a few objects in a single loop?

I have a few objects that have the same fields (referring to Article Types) such as: FAQ__kav, Tutorial__kav, Video__Kav Is it possible to add all of these records to a single list (I guess of type ...
0
votes
2answers
583 views

Apex - break list into multiple small lists before processing

I have a list of 15,000 records. I can maintain the count in a flag. Integer Counter = 15000; I want to break my main list into 3 small lists. Each list should contain 5,000 records. First list ...
0
votes
2answers
45 views

Wrong IsNillable flag for Name field while querying FieldDefinition object

I am trying to retrieve the list of fields which are mandatory and running below query: SELECT id, DeveloperName,EntityDefinitionId,IsNillable,Label FROM FieldDefinition where EntityDefinitionId= '...
0
votes
1answer
27 views

Illegal assignment from List<or_guestsJSON> to or_guestsJSON

I an trying to write a testclass for a JSON object but het the error: Illegal assignment from List to or_guestsJSON. How do I annotate the list in my testclass? Class public class or_guestsJSON ...
0
votes
2answers
40 views

How to get the value from an object

I have an object which gives me the following when I debug :- {name=Baltmore, uid=abcdef00-acft-126a-8cfw-efihfcirffw} I would like to get the uid as a string. I tried agency.get('uid') but this ...
0
votes
1answer
75 views

Create a Case with SOAP in PHP - Failing to map across Contact ID

I have created a connection via SOAP with PHP and I am trying to create a new Case when the user submits the form. I have the SFDC Contact ID of the user and I am trying to insert the Contact Id into ...
3
votes
1answer
282 views

Aura Attribute of Type Object is Supported in Flows?

I am working on a Flow Screen and trying to assign a value to a lightning component attribute from a variable in the flow. The flow screen allows me to select the lightning component but it doesn't ...
1
vote
1answer
16 views

How can I create records that pair to their parents dynamically?

I have batch class which inserts records into a number of different objects from the same logic using dynamic code. My records need to be associated to the correct parent records (i.e. Contacts to ...
2
votes
1answer
1k views

enableChangeDataCapture' not valid in version 38.0

I’m not sure what causes this error message and I’m trying to deploy my app and getting this error message in Jenkins. All Component Failures: ‘1. objects/Employment__c.object -- Error: Property '...
0
votes
2answers
25 views

Figure out which fields are required from Setup

Is it possible to figure out which fields are required from Setup? I mean, I can of course go and look at each field settings and check the required checkbox, but very often I need to look at a few ...
3
votes
1answer
25 views

SOSL on Permission Sets error when no ID is included

I am testing SOSL's on Permission Sets for something I am building and noticed that if I don't include the ID in the fields to request, the search fails: An unexpected error occurred. Please ...
15
votes
3answers
1k views

How to send wrapped generic SObjects from Lightning to Apex

I have a lightning component with an apex controller that wraps generic records in an inner class. When I send the wrapped records to apex and receive them as generic SObjects, I get this error ...
0
votes
1answer
42 views

How to find the mandatory fields on Sobjects in RestAPI /describe

I am trying to create an oAuth based app that integrates with salesforce to create the objects from the app. To let users know what all fields that users needs to put in at minimum to create the ...
0
votes
2answers
1k views

How do I create a Sobject instance in JavaScript, on a Lightning Component controller, to pass to the Apex controller?

I have a lightning component from which I pass some values to a controller. I want to pass the object as a variable and update a field on this object. How do I make the object variable? See my ...
0
votes
1answer
18 views

Downfall of creating apex object using existing Id from SOQL with related object

I want to ask if there is any potential downfall of creating object in apex with Id that I would get from SOQL on diffrent object? Pseudo code SELECT Id, Foo__r.Id, Foo__r.Name from Bar__c Foo__c ...
2
votes
2answers
307 views

Delete an SObject by knowing only Id

Is it possible to delete an SObject by knowing only Id? Here is what I found: Id del = '003S00000099999'; // whatever ID you are deleting Contact ct = new Contact(Id = del); delete ct; So, is it ...
1
vote
0answers
35 views

Tell a component to update its' content when a related record is added on the same record page

I have a Lightning Component in a Record Page on Order object, and whenever I add a product (new OrderItem is created) in the order, I'd like to somehow notify the component to update its' content. ...
0
votes
1answer
164 views

How to find `Selected Quick Actions` in Search layout List View

EDIT: Adding a listview screen shot: As you can see I do not have a listview named List View If I go to quickActions endpoint I can find my quick actions (in my case `New Child Case') But my ...
0
votes
1answer
187 views

Injecting Contact Created in SF on Child BU Journey Builder

I created a Journey in Child BU that uses SF Object Contacts as entry and trigger whenever a Contact Is created. So i tested creating contact and see if it is being accepted under the Child BU JB, but ...
3
votes
1answer
300 views

How to use inner class / wrapper class as scope in Apex Batch

I already successfully collecting the list of data from callout another system as json body to the inner class to accomodate custom information: Here is the apex class of the inner class: public ...
0
votes
1answer
38 views

Sobject does not allow errors [duplicate]

public with sharing class TRAEstimateValidation { public static List<CloudbyzITPM__Task_Resource_Assignment__c> newTRAList = new List<CloudbyzITPM__Task_Resource_Assignment__c >(); ...
2
votes
1answer
406 views

Date Json.serialize removes 00:00:00 digits from datefields of object

I have the following object (invMappingNew): {customerId__c=1, addressId__c=8212BJ154, invoiceType__c=AdvancePayment, invoiceTypeLocalized__c=Voorschot, invoiceDate__c=2015-02-13 00:00:00, ...
0
votes
1answer
29 views

List has no rows for assignment to SObject when the value is returned

Why am I getting the error: List has no rows for assignment to SObject? Here is the function which produces the error: @AuraEnabled public static void setCharacterPose( String ...
0
votes
1answer
303 views

XML object creation. Is there any documentation?

I'm currently working on adding custom fields to an object. However I can't find any documentation or something like this which would indicate me to what should I do to create for example picklist or ...
2
votes
1answer
1k views

Convert Schema.SObjectfield to string

I have a List of Schema.SObjectfield and I want to convert it to String. I am getting below error. System.JSONException: Apex Type unsupported in JSON: Schema.SObjectField Here is my approach. ...
0
votes
1answer
277 views

DML requires SObject or SObject list type: String (line 31)

For the below code I got this error on line 31 i.e upsert z; global class updatezone implements Database.Batchable < sObject > , Database.stateful { string query; string z; //Start ...
1
vote
2answers
727 views

Looping over a list of sObjects that has more than object type

I'm trying to access a field from a list of sObjects which holds 3 different objects types. List<SObject> data = new List<SObject>(); for (sObject li : data) { String sObjName = li....
0
votes
1answer
138 views

Regenerate the salesforce custom object in Illuminate Cloud

How could I regenerate the salesforce custom object in Illuminate Cloud? I need to do that because there are some fields which were added to the object after it was generated by the Illuminate Cloud. ...
0
votes
1answer
498 views

SObject vs Generic Apex Class

Pardon me for asking a basic question. I have just started looking at Salesforce development guides for a project. From my understanding so far, there are objects created through an Object Mapper ...
5
votes
1answer
1k views

JSON serialize SObject including fields with null values

I've currently got a use case where I would like to JSON serialize an SObject, but include fields with null (blank) values. According to the documentation (https://developer.salesforce.com/docs/atlas....
0
votes
2answers
93 views

Collection read only : Unable to add to set

I have to populate a set of Ids with Ids derived from a List<List<sObject>> say searchlist. Below code as I am trying gives me System.Final Exception as Collection is read only and ...
1
vote
1answer
630 views

Setting parent id of attachment object

I'm trying to write an Apex class that queries data from an sObject and then writes that data to a csv file that is downloaded locally so that it can be uploaded to a big object. I'm adapting the ...
0
votes
2answers
133 views

Error deploying standard fields in big object

I'm trying to deploy a big object to Salesforce but there are some errors with the object's fields. The big object is based on a standard object that already exists in salesforce and has some standard ...
1
vote
1answer
550 views

Big Object not deploying to Salesforce

I've been trying to deploy a big object to Salesforce via the Metadata API in Workbench but for some reason, the object isn't showing up in Salesforce. Here are the contents of the files in the ...
-1
votes
1answer
37 views

Sobject reference using parent throws an error

I am using the following SOQL in my code and I am getting an error: Variable does not exist: Parent. Can someone help as to what I may be doing wrong in the code? Thanks. String s1 = 'Account'; ...
2
votes
1answer
48 views

How can I abstract building maps from SObject Lists in a good way? [duplicate]

I frequently find I want/need to map a list of SObjects by a value other than it's own Id. So, I'd like to abstract this process to make it reusable. For example, I might want to map Contacts by ...
4
votes
2answers
180 views

How can I upsert a homogeneous List<SObject>, in a good way? [duplicate]

I have some abstracted code, which at the end of some process will create a homogeneous list of SObjects. It could be a list of Accounts, it could be a list of contacts, it could be a list of some ...
0
votes
1answer
102 views

Not able to update RecurrenceTimeZoneSidKey field on task object

What are the work around the task object in Salesforce, i am trying to update task which is having information in the form of JavaScript object which is mentioned below and when i am trying to update ...
2
votes
1answer
247 views

List<SObject> is instance of SObject?

Object acclist = new List<SObject>{new Account()}; System.debug(acclist instanceof List<SObject>); System.debug(acclist instanceof SObject); The code above prints true true Is List<...
0
votes
1answer
28 views

Preventing inactive Account associations from being displayed

In the Salesforce accounts object, there is an issue with the associated organizations being displayed. Currently, when a new associated organization is added to an account, regardless of whether or ...
0
votes
1answer
301 views

Get SObject fields through REST for use in select all SOQL query

I am producing a query in Java which gets two fields from an SObject collection in Salesforce, and returns them over a REST call. SELECT Id, Name FROM Lead It is possible for me to manually search ...
1
vote
2answers
50 views

Variables undeclared with List<MyCustomMetadata__mdt>

When I changed from the code that's commented out to the current code, the fields from the custom metadata records threw "Variable does not exist" errors. Suggestions on how to correct this? Relevant ...
0
votes
1answer
45 views

Limiting rows returned from a query

I have a class method where I am essentially trying to match Campaign members with a campaign based on a mailing ID. In order to do this, I was originally iterating through the list of all mailings ...
1
vote
1answer
207 views

Comparing two instances of the same custom sObject

I have two instances of one custom object and want to compare all of their fields to make sure they are exactly the same. I have the code below: CustomObject__c validCustomObject = new ...
10
votes
1answer
533 views

Does the `getSObjects` method on `SObject` work with Person Account child relationships?

Our app uses a lot of dynamic SOQL, and in a client org I'm currently getting an error which I can't explain when we're performing a large query against account, including subqueries for all related ...
1
vote
2answers
4k views

Master-detail relationship between standard objects [closed]

Is there any master detail relationship between standard objects? If not, then why there is no master detail relationship between them? I am unable to find such relation between them.