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.

86 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
  • 2,082
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 "...
4 votes
0 answers
108 views

JSForce describeGlobal isn't working when the community has an added URL

I have to be able to get all objects on my salesforce community and whenever i utilize the jsforce library to get the connection by using this method "jsforce.Connection" let conn = new jsforce....
  • 243
4 votes
0 answers
1k views

How do Domain Driven Design principles apply to Salesforce development? (was: Is abstracting away SObject model a good practice for Apex Controllers?)

Domain-Driven-Design principles are largely adopted in companies embracing microservice architecture and one of the key ideas is to separate the data model of the persistence layer from the business ...
  • 1,672
4 votes
0 answers
199 views

How to query the Lightning Sync Error records

Once Lightning Sync is enabled a new report type can be created, selecting LightningSyncError as the primary object. I would need to query this object in order to get the list of sync errors through ...
  • 435
4 votes
0 answers
2k views

What is the reason behind not being able to make a custom lookup field (looking up Standard Object) a mandatory field?

Not sure why we cannot make a custom lookup field a mandatory field, when the looking up object is a standard SObject. e.g. Product Holder (Custom obj) has Component lookup field looking up Product2. ...
4 votes
1 answer
1k 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: ...
  • 3,866
3 votes
0 answers
366 views

How to check for/retrieve record-specific error message, e.g. by errors added through sObject.addError or validation rule?

I'm wondering about the documentation for the sObject class (API 50). It clearly states this for hasErrors(): Returns true if an SObject instance has associated errors. The error message can be ...
  • 982
3 votes
0 answers
92 views

Does List<SObject>.sort method implementation depend on version?

I believe that I have found very interested undocumented bug in Salesforce. I don't see in the documentation saying that List.sort method implementation depends on version, but looks like it does. If ...
  • 14.7k
3 votes
1 answer
98 views

Change sObject field type and deploy using API

In this thread, there is a discussion about modifying a custom sObject's type. When I try to change the field's type in the Salesforce UI, I can see an error message with some references to the code. ...
2 votes
0 answers
846 views

Apex: Copy all populated values from one SObject record to another

I like the way JavaScript lets you easily overlay two objects, retaining the properties of both: let obj1 = {name: 'Foo', quantity: 3}; let obj2 = {name: 'Bar', description: 'A very nice bar'}; // ...
2 votes
1 answer
155 views

Runtime error when Converting sObject to Account (typecasting)

I'm working on a SOAP integration (.NET C#) to Salesforce and I am facing a problem when I try to get results from Salesforce. To do this I'm using the next example code of the Salesforce walkthrough:...
2 votes
1 answer
151 views

Update sObjects in .sfdx/typings

I have a VSCode SFDX Project that we use to develop LWCs, and we recently changed some object names in the Org and now I can't upload anything to our Org. I found that there is a command to refresh ...
  • 1,038
2 votes
0 answers
404 views

findDuplicates method - Not returning duplicates which are captured in User Interface

We have a matching rule on Contact which defines a dupe using the following logic: A fuzzy match on the first Name and Last Name and EITHER a fuzzy match on address (using street or postcode) OR a ...
  • 1,069
2 votes
0 answers
881 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 ...
  • 123
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 ...
2 votes
0 answers
152 views

Capitalization guidelines for Salesforce objects in managed package application UI

Can anyone suggest guidelines for how to capitalise references to Salesforce objects in a managed package application UI, in particular standard objects like Account, Contact etc.? I've read the ...
  • 540
2 votes
0 answers
635 views

Create Public custom settings via REST API

First, is it possible to create a custom object without using Metadata SOAP API ? As per my reading until now it is not possible. I know for a fact, one can create ApexTrigger using REST API. Since I ...
2 votes
0 answers
131 views

Error while parsing object Contract received through Metadata API caused by restrictedPicklist

I retrieve SObjects using retrieve() call from Metadata API and then I'm trying to parse them like described here in comment. The problem occurs while trying to parse standard object Contract. It ...
2 votes
0 answers
91 views

Implementing WorkBadge History for Apex/VisualForce

What I would like to accomplish is create a visual force/apex page that show's how many times someone has received a specific work badge on salesforce, such as the "Thank You" badge. It's similar to ...
2 votes
0 answers
303 views

sObject insert execution not synchronous

I have a custom object and a controller action that creates a new record of this type. The action then returns a page where the list of objects are displayed. save() { ... insert myObject; ...
2 votes
0 answers
33 views

Problem with reports after install

I've recently created a package and I'm facing an unusual problem. Basically, in my development org, this works: String report = String.valueOf([SELECT Id FROM ...
  • 759
2 votes
0 answers
469 views

Invalid sObject type 'DataDotComEntitySetting'

We have Data.com, namespace jigsaw_clean, v 2.16.2 installed and I am encountering an sObject type error when I try to do a simple DML statement in a unit test script. The test method instantiates a ...
2 votes
1 answer
828 views

Querying parent-->Child-->Grand child data using salesforce API

Is it possible to query below data structure using salesforce OOTB API(Rest, Soap or Composite)? Lets assume that from account all objects below have 1:M relationship with their parents There can be ...
  • 7,705
1 vote
0 answers
40 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 ...
  • 11
1 vote
0 answers
82 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
0 answers
469 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 ...
1 vote
0 answers
525 views

How to detect Permission Set Assignments deletion?

I am currently trying to detect changes in permission set assignments within an arbitrary period; it implies creation and deletion. Where profile and permission set assignment creation is straight ...
1 vote
0 answers
25 views

How to truncate CampaignInfluence

CampaignInfluence is consuming a large amount of storage as you can see. Now I've tried to access the object through Workbench etc but no luck. Anyone managed to access the object and do some cleaning ...
1 vote
0 answers
68 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. ...
  • 379
1 vote
0 answers
52 views

How can we add the master record type in the pick list of record type, After creating different record types for account?

When we made different record types of an object, how can we add master record type in pick list also? In pick list option, all custom record type other than master record type are shown.
1 vote
0 answers
223 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
0 answers
306 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 ...
  • 4,621
1 vote
0 answers
1k views

How to clone record with its related list using custom clone list button in Sobject?

Clone record with its related list and update the picklist value i have created one button on record top beside the clone button, when clicked, execute code that would make a new version record with ...
1 vote
1 answer
426 views

Visualforce page usingbase standard controller

I have the following Visualforce page and controller: <apex:page standardController="sObject" extensions="ExtensionController"> <div> {!o.Id} </div> <div>...
  • 518
1 vote
0 answers
33 views

Tracking changes to object structures through SOAP API

I am looking to check whether the object that I queried has changed during the previous access. For example, if a new field was added to the Account field, I would like to alert the user that a new ...
  • 1,089
1 vote
2 answers
233 views

Add canvas app to layout of all object

How can we add connected canvas app to layout of all the objects like account, opportunity, custom objects etc. Currently I have to go to each object, edit layout and add canvas app. Also, If ...
  • 111
1 vote
0 answers
974 views

SObject deployment: Cannot specify a startsWith attribute for this language

I'm trying to deploy an sobject to a new empty environment. I get the following error: Cannot specify a startsWith attribute for this language Both orgs are in English. Any thoughts? Edit: The ...
1 vote
0 answers
423 views

ExactTarget Landing Page form - getting a ExactTarget error message if two non-required fields are empty

I have an ExactTarget Landing page form that create a SF Lead when submitted. If every field is filled out(approx 20 fields) everything passes into SF with no issue. The problem is this - of the non-...
  • 23
1 vote
0 answers
2k views

Trying to determine fields I want to set dynamically rather than hardcode - very close / not possible

I am messing around with the dynamic nature of Salesforce. I want to clone Opportunity into a custom object. It's a very easy requirement in itself. What I am trying to do is make if completely ...
  • 2,132
0 votes
0 answers
35 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 --...
0 votes
0 answers
29 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 ...
  • 33
0 votes
0 answers
27 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' ...
  • 1
0 votes
0 answers
26 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 ...
  • 13
0 votes
0 answers
61 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....
0 votes
0 answers
32 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="...
  • 33
0 votes
0 answers
34 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 ...
0 votes
0 answers
40 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
0 answers
104 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 ...
  • 909
0 votes
1 answer
121 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 ...