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
3 votes
1 answer
40 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 ...
1 vote
1 answer
27 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 ...
6 votes
1 answer
2k views

Unable to read SObject error in Lightning Component when record has been queried from the database

I had encountered the "Unable to read SObject" error when attempting to pass an SObject record from Lightning to an @AuraEnabled Apex method. Based on this question, I first tried setting the "...
1 vote
0 answers
37 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 ...
0 votes
0 answers
25 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 ...
1 vote
1 answer
118 views

Hello everyone, I need some help with triggers

So basically, I'm struggle in this trigger. What I have to do is: get the max Commission Amount value of the contacts from an Account, check which is the largest and trigger a check box field called &...
0 votes
0 answers
21 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' ...
0 votes
0 answers
25 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 ...
0 votes
1 answer
33 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 ...
0 votes
0 answers
41 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....
2 votes
1 answer
1k 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 ...
0 votes
0 answers
17 views

Aura with LWC override new button do nothing after redirect back

I am using aura wrapper with lwc to override new button. It works great first time, but second time my aura is not triggered at all. If i reload page it works. <aura:component description="...
0 votes
1 answer
47 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 "...
0 votes
0 answers
23 views

Salesforce CLI Export Error sObject type 'Product2' is not supported

I logged into CLI successfully with the command sfdx force:auth:web:login -r https://login.salesforce.com And tried exporting using the below command and below is the error C:\Users\xxxxx>sfdx ...
1 vote
2 answers
943 views

Get Account.Name using SObject.Get()

I'm trying to get value of a lookup field, by using SObject.Get(). I'm using this method because i want to make this class generic. That's the relevant piece of code: for(SObject sobject_i : ...
1 vote
2 answers
57 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=...
0 votes
1 answer
71 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 ...
0 votes
1 answer
45 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 ...
15 votes
1 answer
4k 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 ...
0 votes
1 answer
67 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 ...
-1 votes
1 answer
48 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 ...
1 vote
1 answer
91 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 ...
1 vote
1 answer
88 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 ...
-1 votes
1 answer
55 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 ...
1 vote
0 answers
426 views

Invalid Field for SObject

I have 2 fields that I'd like to use in my VFP. Valores_ativos_e_passivos__c is working fine, but when I try to use Ativos_e_passivos__c I receive the Invalid field for SObject error. What am I ...
-2 votes
1 answer
79 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 ...
5 votes
2 answers
2k views

Methods to Check if Sobjects are Equal

Use Case: Need to allow changes to only one specific field on an opportunity when at a certain stage. Problem: How to efficiently determine within a trigger context that a only the specific field ...
1 vote
0 answers
71 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 ...
1 vote
1 answer
39 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 ...
0 votes
1 answer
308 views

Schema.getGlobalDescribe().get(objectType); doesn't work with custom objects

I have a method that returns a map of all the fields where the field's API name is the key and the object Schema.SObjectField is the value. private static Map<String, Schema.SObjectField> ...
0 votes
1 answer
197 views

Display sObject List in Visualforce page

I want to create an overview of a list which contains content from different objects. I will try to add in this list the files, tasks, events, emails and notes. I would like to show this list on the ...
0 votes
0 answers
33 views

Salesforce API when will trigger fire on updating multiple dependant fields

I am updating multiple fields within a single sobjects/customobj__c Salesforce client Patch request. All these fields are on the same customobj__c object for a single record. I have say 2 fields in ...
0 votes
2 answers
128 views

Cleaner way to filter specific object ids from List <String>?

I am trying to update one of the related objects once the Account merge is completed. Database.MergeResult results = Database.merge(masterAcct, duplicateAcct, false); getUpdatedRelatedIds() method ...
1 vote
1 answer
45 views

Get notified when a new custom field is added or an existing field metadata is updated

I would like to get alerted when a custom field is added or if an existing field metadata is updated such as if it's data classification setting has changed. Programmatically only thing I can think of ...
1 vote
2 answers
317 views

How to change description of Standard Object

Does anyone know if there is a way to edit the description of a standard object, I have an Edit button only on Custom object. Thank you !
1 vote
1 answer
1k views

Why TwoFactorMethodsInfo is not accessible?

I want to run a SOQL query on this object TwoFactorMethodsInfo. Yet by some reason it is not supported: This documentation references it https://developer.salesforce.com/docs/atlas.en-us....
0 votes
0 answers
78 views

Database.emptyRecycleBin and Empty your organization's recycle bin not deleting records

I'm trying to understand why records are not getting removed from our recycle bin. When I go to the UI and click 'Empty your organization's recycle bin' it doesn't appear to dump the data. Also ...
8 votes
2 answers
12k views

Clone list of SObject records using deepClone() to clone all the fields on records

I am trying to clone the records of a custom object. I know that I can use the deepClone() method of the List class to do this. List<MyCustomObject__c> originalList = [Select Id, Name, Age From ...
0 votes
1 answer
88 views

Create custom object using Partner wsdl which has a parent ID (SOAP API)

When creating a new record using the partner wsdl SOAP API how do I add the parent id to the generic sObject. We have a parent record of Account__c and child records of Store_Visit__c My attempted ...
-1 votes
1 answer
42 views

Get all records created by user today

We are about to perform Load Testing and we are performing some complex scenarios. We use a CPQ tool that has many custom object records being involved and inserted. Is there an easy way to get ...
1 vote
1 answer
62 views

Conditional apex output field

I have a data table in a visualforce page where I would like to display "nothing here" if my sObject field is empty, but if there is something written inside i would like to display it. i ...
1 vote
0 answers
42 views

Is it possible to POST multiple Tooling SObjects with a single request? [duplicate]

I've seen and tested that I can create or update single records of TraceFlag (for example) using "/tooling/sobjects/SObjectName/". However, years of working with Salesforce has ingrained in ...
0 votes
1 answer
54 views

Typecast to SObject list to SObjectType passed to a method

I have a list of SObject and SObjectType parameters passed to a method sObjectTypeRecord in the below method contains Lead.SObjectType,it can also contain any other SObjectType like Account....
1 vote
1 answer
37 views

Test Method Issue for removing duplicates from List

I have a requirement to remove the duplicate objects from a list at several places in my integration code and I have developed a method in the Util class to remove the duplicate objects from the list. ...
0 votes
1 answer
124 views

Get Data of Sobject dynamically

I'm trying to get a field value of a Sobject. for example for Case. String cas = 'Case'; String caseid = '5003O000008QNUOQA4'; String query = 'SELECT Id,RecordTypeId,Answer_Type__c FROM ' + cas+ ' ...
1 vote
1 answer
369 views

sObject types from string

I am trying to determine how to convert a string to an sObject and use it in a List, Map, ... For example can I use the acctString as followed: private Sobject stringToObject; String objectString = '...
0 votes
0 answers
249 views

Getting 404 Error when trying to create a Lead object in SalesForce API

I'm sending a POST request from a connected app to try and create a Lead object in my company's dashboard. Here is the URL that I'm using to post: https://${MyOrganization'sBaseURL}.my.salesforce.com/...
1 vote
4 answers
9k views

SOQL - Listing out down columns of a SObject

In Oracle, I can issue the following command to get me the table structure and list down all the columns of a table. desc table_name TABLE COL1 <DATA TYPE> <NOT NULL ETC> COL2 .............
0 votes
1 answer
183 views

Save Parent - Child Hierarchy for same SObject in a single DML

I want to save the lookup relationship for same object in a single DML statement, so basically I want to do something similar like this but for same Sobject, I have found one article here but this is ...
6 votes
1 answer
3k views

No such column on sobject error occurring on sObject that does have that column

When attempting to update a custom object using SF default API endpoints (/services/data/v43.0/sobjects/MyCustomObject__c/customId__c/4003) I am getting a weird error telling me that a column doesn't ...

1
2 3 4 5
13