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
1answer
41 views

Convert object as string to json

I have an object which is converted to string in a text field. How can I convert this to a JSON string. String of object: Profile:[UID=, crmId=0000o00002XXXXxXXX, email=top@top.com, firstname=null, ...
0
votes
0answers
22 views

Retrieving User from Salesforce failing with 411 error

I'm attempting to retrieve a custom object record by one of it's unique fields using the built in api. For this specific call, my request is is: path: `/services/data/v43.0/sobjects/YTPStudent__c/...
0
votes
1answer
26 views

Invalid conversion from runtime type Map<String,SObject> to Map<String,OrgWideEmailAddress>

I am trying to cast the type Map<String, SObject> to Map<String, EmailTemplate>, my code as follows: EmailTemplate emailTemplate = [SELECT Id FROM EmailTemplate LIMIT 1].get(0); SObject ...
2
votes
1answer
58 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:...
1
vote
1answer
50 views

Explanation of an notation List<name.test> nameList

I have a piece of code as following: List<name.test> nameList In List is name a class or object. Why would we use such an annotation? Or for example: method(name.test variable)
3
votes
1answer
120 views

Generic List to Map?

I have two functions that convert a list of SObjects to a map. They do the same thing except that the SObject is different. How can i combine them to one generic function? private Map<String, ...
-2
votes
1answer
30 views

How to get child object name from child relationshipname using Apex? [closed]

Example: Parent Object Name: Opportunity Child relationship Name: OpportunityLineItems Child object Name: OpportunityLineItem
0
votes
0answers
52 views

Break a list of id's to multiple list into equal number of records [duplicate]

I have created a list of id where i am adding record id of a custom object. List<Id> validProjectId = new List<Id>(); validProjectId.add(project.id); Now that this list has suppose 1000 ...
2
votes
1answer
31 views

SOQL query for all Users who have read access to Task object

I am trying to write a SOQL query to find a list of Users who have read access to the standard Task object but my query keeps coming back empty. Is there a better way to do this? I have a dropdown ...
4
votes
0answers
47 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....
0
votes
2answers
47 views

Convert JSONParser to SObject

I'm trying to convert a JSON file, which has information from one or more objects. I saw that one way was to transform the JSON String to JSONParser and loop to generate the objects. I want to ...
0
votes
0answers
27 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
0answers
28 views

Where are case comments located?

I am looking for the case comments object within Workbench, but I am unable to find where the replies are being stored. I found the main parent comment located within CommentFeed, and it also shows ...
4
votes
1answer
141 views

How to accept generic “SObject” in Lightning Web Component for Flows?

I've got a custom built LWC to be used within a screen component in a flow. My component basically renders a collection of SObjects in a distinct way. It can also deal with different types of sObjects....
1
vote
1answer
124 views

INVALID_TYPE: sObject type 'InstalledSubscriberPackage' is not supported

I'm querying the tooling API via some external C# code to get a list of installed packages. SELECT SubscriberPackage.Name, SubscriberPackage.NamespacePrefix, SubscriberPackageVersionId FROM ...
1
vote
1answer
78 views

sObject type 'MetadataComponentDependency' is not supported

If I understand correctly MetadataComponentDependency supports standard and custom fields on standard objects, but neither on custom objects. Will it eventually support standard and custom fields on ...
0
votes
3answers
42 views

How to assign a value to an Account sObject

I am trying to create an Account sObject so that I can reference at my later code. For the purpose I am running a query on Contacts, and then I pick fields from it and assign them to my Account ...
0
votes
0answers
26 views

Alternative to Delete Trigger for tracking deleted records in OpportunityShare Object

We want to track the deleted records in OpportunityShare Object for some reason. This object doesn't support to write a trigger. Is there way to track those deleted records?. Any suggestion would ...
0
votes
1answer
38 views

How to get hierarchy of all objects dynamically through schema code

How to get a hierarchy of all objects dynamically through schema code in Salesforce I have code like below. Set<String> strForRelatedObjects = new Set<String>(); Schema.SObjectType ...
0
votes
3answers
164 views

Field is not writeable: User.UserType

I'm trying to test a scheduled Apex class and I have a method that generates fakes users within my test class: List<User> newUsers = new List<User>(); Profile p = [ SELECT Id FROM ...
0
votes
1answer
61 views

Individual Object Installation

Our org wants to implement the Individual object in our SFDC to comply with GDPR. Problem: We want to flag 'individuals' who chose to be forgotten with the 'shouldForget' field as a flag. ...
-1
votes
1answer
42 views

Queried column disappears from results

I just added a new field to a custom Salesforce Object. I now want to query that field from the database. If I query it from the developer console, everything is fine. However... If I query it from ...
0
votes
2answers
46 views

Object Relationship Tree

I am currently trying to figure out how to elicit an object relationship tree from Salesforce, so I can export test data to use in my Scratch-Orgs. Basically what I want to do is poll to produce a ...
-1
votes
1answer
35 views

Unable to access values from the old map

Currently, I'm trying to get values from an old map because currently, my map is like Map <Id, Sobject> It's showing an error like Variable does not exist: ARPU__C I'm unable to fetch data ...
0
votes
1answer
24 views

unable to set value of recordId for navigateToSObject where value is coming form aura:iteration

I am new to Lightning component I have created a simple app for my sand box. i which i am trying to access my record home page in the first step I have created simple list of task in which I have got ...
1
vote
0answers
175 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 ...
0
votes
2answers
389 views

LWC Composition for Custom Layout inside a lightning-record-form

I have a SObject with multiple display layouts. Now, I want a way to display a particular layout in my lightning-record-form with different lightning-input-field. I don't wanna attach all the fields ...
1
vote
1answer
61 views

Limitation on using getPopulatedFieldsAsMap method

I am excited to getPopulatedFieldsAsMap that being released on Summer 16 . I tried to run query however some of field does not return value. I thought it was bug but somehow it should be fixed in ...
1
vote
0answers
15 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 ...
2
votes
0answers
45 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 ...
0
votes
2answers
66 views

How to pass dynamic object into for loop

I have a standard controller from which I get the object. How can I use this in a for loop? Apex ... public ListToStringContact(ApexPages.StandardSetController controller) { setCon = ...
1
vote
1answer
46 views

SObject List vs Map instanceof subtype

Map<Id, SObject> sObjectMap = new Map<Id, SObject> (); System.debug(sObjectMap instanceof Map<Id, Account>); // false System.debug(sObjectMap.values() instanceof List<Account>);...
1
vote
1answer
56 views

How to add formula field to SObject instance using apex

I need to a add formula field to SObject in Apex before the record is persisted. Sobject.put(formulaFieldName, null) returns the error that the field is not editable. I would need to run SObject....
0
votes
1answer
25 views

user merge fields doesn't replace by user record ID

I am trying to send email through email template to user but It is always replacing the user merge fields by org admin's user name instead of targetobjectID user. Org admin : luke wright Email ...
0
votes
1answer
60 views

Error when trying to send post request via python /composite/sobjects

Pretty much title says all, I was able to get the snippet within test = {} to work within salesforce workbench. Would love some guidance on what I am doing wrong as individual "non-bulk" requests work....
8
votes
2answers
502 views

How would I test a trigger on non-writable SurveyResponse object?

I'm using Salesforce Survey for one of the requirements. I would like to write a trigger on SurveyResponse object. I've written the trigger and apply the logic that I need. Now, I'm trying to write a ...
3
votes
2answers
137 views

What happens when I edit an sobject in a Set?

When I change an object in a set to match the other object in the set do they now merge? When I have a set of 5 sobjects, and they are all unique objects (unique Signatures) I add them to a Set, ...
1
vote
3answers
351 views

'json Not a Valid Enumeration for type' Error When Retrieving Standard sObjects with IntelliJ/Jetforcer

I use IntelliJ with Jetforcer for Salesforce development. Starting yesterday, I began receiving the following error when trying to retrieve Standard sObjects for my project: jsonNot a valid ...
0
votes
1answer
37 views

Overwrite a related list for an sObject inside a Map without looping?

Question: Salesforce allows me to write specific field values to specific related list records on an object in a Map by referencing the __r[Index] relationship of that particular record. However, it ...
0
votes
2answers
59 views

Which object should be used in storing files?

The Attachment object looks like the correct choice if you have a file you want to relate to only one record. ContentDocument with ContentDocumentLink looks good if you have a single file you want to ...
2
votes
1answer
163 views

Retrieve SObject using Schema SObjectType class

I am trying to create a dynamic class to retrieve a record for update. I struggle with the following part of the code: targetSObject = new sor.getSObjectType()(ID = sObjectID); For example, if this ...
0
votes
1answer
120 views

Get Field value from object using string key

I am trying to do get values from the object using string key, I have typecast the Contact object into the object but not getting value. Please help how to get value from the object using string API ...
2
votes
2answers
157 views

Benefits of using sObject.clone versus creating a new record

Hello I am curious whats the use case of the clone method. Also when its beneficial. Example here I create a lead once then clone it 200 times. list<lead> leadlist = new list<lead>(); ...
1
vote
0answers
78 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 ...
0
votes
0answers
43 views

How to store a collection type (set, map, list) on a object?

I have a visual-force page which displays an Apex form with some dynamic number of input text fields that I would like to save on the Opportunity object. Is the easiest way to serialize them as JSON ...
1
vote
1answer
47 views

How to enable read permissions for organization sobject?

I'm trying to use the salesforce standard rest api to access the organization sobject so I can read the name of an organization I'm working with. I make a soql query "SELECT Id,Name FROM Organization ...
2
votes
1answer
75 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 ...
0
votes
4answers
83 views

How to find the schema for a sobject

I am trying to build an API which under the hood will perform CRUD operations against the Salesforce API. I'm using the node-salesforce library for communication with Salesforce. An example of ...
1
vote
1answer
57 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 : ...
0
votes
1answer
93 views

Rendering Visual Force page as PDF via the REST api

The documentation suggests that a Visual Force page can easily be rendered with apex: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_render_in_apex.htm // ...