Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

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
0 votes
1 answer
18 views

SurveySubject object relationship

I'm a little bit confused. Doc says that SurveySubject has ParentId field that Unique identifier of the SurveyInvitation object or SurveyResponse object that is associated with this survey-object ...
pincet's user avatar
  • 925
0 votes
1 answer
48 views

Addressing Restrictions in Passing SObject Fields: LWC to Apex

There are several topics related to this issue: Salesforce LWC - Pass standard object to Apex Class How do I pass sObject record from LWC to Apex Controller? How do I pass a SObject record from LWC ...
Tzinm's user avatar
  • 21
0 votes
0 answers
21 views

Can't access financial goals object in Financial Cloud (FSC) using apex

I am trying to access financial goal object from my financial cloud using apex command as follows: Map<String, Schema.SObjectType> allSObjects = Schema.getGlobalDescribe(); for (String ...
Komal Riaz's user avatar
0 votes
1 answer
39 views

Compare 2 Lists of same sobject and store the unique records in a list

I have 2 List<Sobject> one contains existingRecordsList and other updateRecordList. existingRecordsList = (Account:{abc__c=a0o7a000,xyz__c=a0o5r000, id =a0o5r000002GaHhAAK}) updateRecordList = ...
Raham's user avatar
  • 43
-3 votes
1 answer
100 views

Line: 4, Column: 23 Invalid constructor syntax, name=value pairs can only be used for SObjects: Contact

Line: 4, Column: 23 Invalid constructor syntax, name=value pairs can only be used for SObjects: Contact List<Contact> conList = new List<Contact>(); // here is Empty List for Contact ...
rajesh hyalinge's user avatar
0 votes
0 answers
54 views

How to convert an OpportunityChangeEvent to an Opportunity object?

I am writing an async apex trigger for Opportunity. The trigger gives me an OpportunityChangeEvent object which has all the fields of Opportunity (in addition to fields like "ChangeEventHeader&...
SatheeshJM's user avatar
-1 votes
1 answer
126 views

Get all Records Using sObject Collections

I see this page: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_retrieve_post.htm but it seems to require a list of record IDs. I ...
Zombo's user avatar
  • 1
0 votes
1 answer
278 views

Why are there some objects which are not visible in Object Manager in salesforce?

There are some standard objects like ContentDocumentLink, ContentDocument, ContentDocumentHistory; why these aren't visible in object manager or schema builder even when you have admin privileges. ...
dshrikant's user avatar
  • 103
0 votes
1 answer
148 views

How to Dynamically cast the type of an 'Object' in apex at runtime

Let's say we have a Map<String,Object> we got from an lwc, and we need to create records for any given SObject that can change based on some custom metadata type records. I have the following ...
SouthJoe's user avatar
2 votes
1 answer
181 views

Composite sObject Collection call not reaching limit

The Composite API docs (ref) asserts that You can have up to 25 subrequests in a single call. Up to 5 of these subrequests can be sObject Collections or query operations, including Query and QueryAll ...
mhery's user avatar
  • 121
0 votes
1 answer
267 views

How to deactivate all flows via sf cli

I'm trying to deactivate all active flows via sf data cli I saw docs said we can deactivate if via Metadata field You can activate and deactivate flows with the Metadata field. Below command is ...
vctqs1's user avatar
  • 85
0 votes
0 answers
16 views

Updating a custom field in a packaged org updates the namespaced field instead, is there a workaround for this? [duplicate]

I'm currently testing my application in a packaged org, and am trying to update a field: custom_field__c of the lead object that i created. I use my app installed in the packaged org to update that ...
dshaw's user avatar
  • 1
1 vote
1 answer
268 views

How to write to a non-writeable field such as formula fields or CreatedDate during unit tests?

TL;DR How can I write to non-writeable SObject fields while running apex unit tests? Background While creating unit tests that check a method's functionality independent of any DML functions, it is ...
Jwok's user avatar
  • 789
0 votes
1 answer
784 views

How to iterate over map with id and Sobject list

I have the following piece of code: map<id,List<Spot__c>> spotMap = new map<id,List<Spot__c>>(); List<application__c> apPList = [SELECT ID, Account__r.id,(SELECT id,...
Thomas's user avatar
  • 2,298
0 votes
1 answer
207 views

How to retrieve exactly all SObject Names in Object Manager

On the Object Manager tab, My org has 173 objects with 172 standard objects and 1 custom object. However, when I use System.debug(Schema.getGlobalDescribe().values().size()); It returns 1058 records. ...
Tuấn Trần quốc's user avatar
0 votes
0 answers
378 views

Error when querying Salesforce REST API - order object with full query, but works fine with limited results and querying just one field

I'm encountering an issue when performing a REST API query for order object on Salesforce, specifically when using a full query that includes multiple fields. However, the query works perfectly fine ...
Athithya Vidyarth S's user avatar
-3 votes
1 answer
294 views

What do the SObject.clone(preserveId, isDeepClone, preserveReadonlyTimestamps, preserveAutonumber) method parameters do?

At Apex code while cloning the record: clone(preserveId, isDeepClone, preserveReadonlyTimestamps, preserveAutonumber) Need to know the each parameter how does it work. Contact obj = new Contact(Id ='...
Chetan Awate's user avatar
0 votes
2 answers
90 views

Adjust for missing fields in Test SObject avoid erorr - SObject row was retrieved via SOQL without querying the requested field

I have created an Apex Class to compare the current and prior values of SObjects. If differences are found the field labels are outputted to a ; separated string which I am using to populate a Multi-...
Jeff Callahan's user avatar
0 votes
1 answer
150 views

Copy Field Values to a different Record Type

We need to keep an audit of all field changes for a Custom Object, Work Experience. I have created a separate child Object, Work Experience Audit, which has all of the same editable fields. I have ...
Jeff Callahan's user avatar
2 votes
0 answers
110 views

Is it applicable to check equality with operator for SObject field values?

Recently I was writing a code to check if sobject had changed values in fields. And I came across a question. Right now I have this code to check values diff: Object newValue = newRecord.get(fieldName)...
Jack Veromeev's user avatar
0 votes
0 answers
60 views

Update sObject from Batch Apex when the sObject's other custom field value is invalid

So we have a situation where we have some custom sObjects that have some custom fields that are picklists. From time to time an Apex batch job runs to update picklists in Custom_Field_1__c. Now we add ...
zaitsman's user avatar
  • 1,930
0 votes
1 answer
370 views

Possible to remove or ignore errors from trigger-context SObject after .addError() in Apex?

With Apex, after calling .addError() on a trigger record is there any way to subsequently remove that error such that the DML operation will complete successfully? I don't see any Database methods (...
Brent Bowers's user avatar
  • 3,144
0 votes
1 answer
158 views

Cannot find field level permissions on standard field

I am having some SOQL queries fail when I include the field "Street" when querying for a Lead. This is the kind of query I'm running and the error message back: SELECT Id, Name, firstName, ...
jerfp's user avatar
  • 111
1 vote
3 answers
364 views

Query Lookup Relationship With SOQL Not Working

I have a SalesForce custom object named Loan__c which has a Lookup field called LoanLead__c and I'm trying to query that relationship with SOQL but I'm getting an error when I run the query SELECT Id, ...
Daniel Phillips's user avatar
2 votes
0 answers
112 views

Package version creation failed Invalid type: EntitySubscription

I am getting the below error when I am trying to create a patch version. Package version creation failed with an unknown error. Invalid type: EntitySubscription. This Sobject is available in the ...
Saurabh's user avatar
  • 27
0 votes
0 answers
113 views

Deployment error on sobject without message

I am pushing Account sobject on save. File is CustomData__c.object, not multiple for each field. It says "Deployed with status SUCCEEDED_PARTIAL, but no error is displayed. They are displayed in ...
Leged's user avatar
  • 1
-1 votes
2 answers
161 views

Bulk update of custom field value in salesforce object failing due to custom validations and triggers

I added a custom field to opportunity salesforce object. It's name is externalId__c. The field is added to the object. However when I am trying to update the value of externalId__c for all the records,...
Chitvan Mishra's user avatar
0 votes
1 answer
249 views

UserAppInfo query fails because userId not there

I'm tracking down a bug that fails on this query because it returns no rows. The user I'm using is relatively new and still working out the kinks: UserAppInfo userApp = [SELECT Id, AppDefinitionId ...
mackmama's user avatar
  • 707
-1 votes
1 answer
1k views

what sobjects are supported in a queue

What objects can in include in Queues? Online i can see only these objects can be in included in a Queue: Cases, Leads, Tasks, Contact requests, Orders, Service contracts, Knowledge articles and ...
Luis Aguiar's user avatar
0 votes
0 answers
224 views

Running Salesforce Code Analyzer for method version 3

I'm trying to run the SalesForce Code Analyzer on the new version 3 to a unique method called deleteQuery and the deleteQuery has a parameter Id here what I'm using: "sfdx scanner:run:dfa --...
Matheus Mello's user avatar
3 votes
1 answer
2k views

How to calculate how much storage a CSV will use when uploaded to SObject

So I have a .csv file that contains ~12,000 rows and on my local filesystem takes up about 3MB of data. I assumed that when I imported this csv into a Salesforce Object, the data would still take up ...
Tyler Edwards's user avatar
1 vote
1 answer
210 views

How do field types convert from json and SF object

I am working on a lwc. I am passing a array of json objects into a apex method. The parameter for the apex method is a List<Work_Items> where work items is a SF object. At run time apex converts ...
Zdev's user avatar
  • 21
1 vote
0 answers
168 views

SystemModStamp and LastModifiedDate contains different date

I have checked and part of my records contains different date in that fields. Systemmodstamp is 9.10 and LastModifiedDate is 5.10. I thought that systemmodstamp is different because of automated ...
gikew's user avatar
  • 11
0 votes
0 answers
41 views

Record field is empty after package update

I have custom managed package and created record of sObject(Response__c) from that package with namespace. And after updating package to new version one field(Message__c) became empty. That field is ...
ravipo's user avatar
  • 43
0 votes
0 answers
238 views

Reenable 'Visibility' field on FeedItem

We've been using the 'Visibility' field (the one defined here) on the 'FeedItem' object. These have been removed/changed/hidden somehow -- all of the sudden, we get "No such column 'Visibility' ...
Daniel's user avatar
  • 1
0 votes
0 answers
29 views

Need help figuring out how to build a Questionaire based on objects in Salesforce, display in an Experience Cloud Page with generated URL

I'm trying to wrap my head around something pretty complicated. Users want to dynamically build out a form with Questions and Answers that will display on a Experience Cloud Page. There will be a bank ...
C.Flye's user avatar
  • 23
0 votes
1 answer
366 views

common.apex.runtime.impl.ApexFieldToken

We have using SmartFactory class from long time. But, recently we are facing issues while running smartfactory unit class. Smart Factory Git hub repo. When I try to see the logs I've found out this. I ...
Pavan tej's user avatar
  • 1,460
0 votes
0 answers
326 views

Attachment API returning Status=Not Found, StatusCode=404 from Apex but works from Anonymous window & workbench

I am trying to access Attachment info using /services/data/v56.0/sobjects/Attachment/\<attachment-id\> which works fine from workbench. It also works fine from Anonymous window using URL....
farooq.ind's user avatar
0 votes
1 answer
232 views

I need to update all Contact Fields dynamically , I am trying throught Schema.SObjectType but getting some Error

I need to update all contact records from one record to another record which has 333 fields. It takes time to update this. I thought of updating the sobject field dynamically, but I'm getting "...
Vinitha vino's user avatar
1 vote
2 answers
382 views

APEX equivalent for SObject Tree -> insert nested objects

I often encounter usecases where i need to insert nested objects. While i know that it is feasible to leverage external Ids to achieve the insert in a single DML operation Account a = new Account(Name=...
Philippe's user avatar
  • 188
1 vote
1 answer
730 views

Give access to User.ProfileId without "View Profile and Configuration" permission

I created a flow that has to access the profileId of Order.Owner: But when the user runs the flow, the following error occurs: "An error occurred: The flow failed to access the value for ...
Cline's user avatar
  • 111
0 votes
1 answer
540 views

Why I have a standard field Case.isStopped field on one environment but I don't have the same field on the second environment?

I have a field Case.isStopped (label: Stopped) on my Developer organization which I created 2 weeks ago but I don't have that field on full copy Sandbox that was created a long time ago Can it be ...
LucyFenel's user avatar
1 vote
1 answer
721 views

sObject.clone() - Does this method clone values in fields marked as Unique?

Given the below Account field: foo__c Text(255) (External ID) (Unique Case Insensitive) If we use the following in Apex code, does a value in the foo__c field get copied over to the newly cloned ...
parkerbbrown's user avatar
0 votes
1 answer
364 views

What set of fields gets returned from .getSObject(fieldName)?

I'm working on a function that does a series of .getSObject() calls from an Account record to get three fields from one of the related records. The issue I'm having is one of the fields returns a ...
Arin Zandbergen's user avatar
1 vote
1 answer
252 views

Yet another question on SObject's isSet function

This is a question about the isSet function on SObjects. Compare a similar question from 2019 here, but the discussion did not go beyond OwnerId. In my case, Apex gets a QuoteLineItem from a query (in ...
Felix van Hove's user avatar
1 vote
1 answer
201 views

prefix Phone field, different Objects

I have a method in beforeInsert trigger, when new SObject is inserted it should add a numeric prefix. That alone is working, but my assignment now is make it much shorter. Currently I'm having 1 block ...
jur1s77's user avatar
  • 47
-1 votes
1 answer
313 views

Add List of Inserted Id's to generic sObject List

I need to replicate the standard "Create Records" Flow Element in an Invocable Apex Class so that I can include some additional code before and after the insert. I am using generic sObject ...
Jeff Callahan's user avatar
-2 votes
1 answer
229 views

The map collection declared by apex is not accepted by lwc

The map collection declared by apex is not accepted by lwc. Schema to get all field names corresponding to the object.I made apex code using SObjectType. System.debug was used to verify that there ...
Yeonbi Ji's user avatar
1 vote
0 answers
128 views

How to change field value of sObject in LWC?

I need to write the equivalent code in LWC . Here a sObject is defined in aura cmp and then it is assigning a value to one of its field which is Source__c. CreateCaseActivity is a sObject. How can i ...
Shashwat Chaturvedi's user avatar
1 vote
1 answer
193 views

Default value for new lookup fields

I have created a lookup between two custom objects. Object A is an existing object that has a new lookup to object B, a new object. For the next few months I need to have a scheduled batchjob to keep ...
Snowgoon's user avatar

1
2 3 4 5
13