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
votes
0answers
23 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
32 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
27 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
18 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 ...
0
votes
0answers
72 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
50 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
35 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
14 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
0answers
13 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
37 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
41 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
38 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
20 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
31 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
144 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
136 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
270 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
28 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
39 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
75 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
40 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
120 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
30 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
41 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
28 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
51 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
36 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
17 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
48 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 // ...
0
votes
1answer
68 views

Sobject for contact and leads

I need help converting this method's parameter into an sobject, so it can accept two different types of objects So currently the method is returning a lead activity record, but I want it to return a ...
1
vote
1answer
26 views

unable to read sobject when object has id null

I am actually getting the error "Unable to read sobjet", when sending an object to my server even if I specify the sobjectType as follow : sendforSave : function(component) { var habitatInfo = ...
-1
votes
1answer
24 views

How salesforce compares on sObject with another

We know that "Set" is a collection of unique records. If I am creating a set of SObjects, on what basis Salesforce identifies Uniqueness of the entries in the Set?
1
vote
2answers
66 views

How do i iterate over a list with 3 different object types in lightning component?

I am building a lighting component which needs to iterate over a list with three different object types but I have run into a problem because I cannot write an aura if expression which checks the ...
1
vote
1answer
43 views

How to access Owner field using getDescribe().fields.getMap()

I have a below code to access owner field from sObject. Map <String, Schema.SObjectType > sObjects = Schema.getGlobalDescribe(); Schema.SObjectType targetType = sObjects.get('...
-4
votes
3answers
87 views

how to create dynamic query [closed]

List<Opportunity> opps = [ SELECT Id ,Name ,Amount ,CloseDate ,Stagename ,Near_to_Close_Date__c ...
0
votes
2answers
56 views

Convert List<String> into List<Schema.SObjectField>

I have a below code public PageReference SyncCandidatewithMirror(map<Id, cxsrec__cxsCandidate__c> NewMap,Map<Id, List<String>> fieldChangedMapChanged, List<...
0
votes
1answer
23 views

How does joining two custom objects into one custom object through master-detail relationship work

I've been working on a test method but I've had a problem creating the setup of it. public static List<Job_Posting__c> createPostings(){ List<Job_Posting__c> testPostings = new ...
0
votes
1answer
96 views

Not able to find a standard field CompletedDateTime on Task object

We are not able to see CompletedDateTime field on Activity or task object in the production environment but the same is available on Its sandbox. Can someone please suggest if there is any way to ...
1
vote
1answer
33 views

How are action overrides handled for managed package upgrades?

I want to override a custom object's "New" action with a Visualforce page in my managed package. (This is the mechanism where the platform's default New or Edit or View etc. actions can be routed to ...
0
votes
1answer
101 views

Trying to create a new User, cannot create new user because of profileID

I am trying to create a new user inside of Salesforce using nforce. However, every time I create the user I get the error: FIELD_INTEGRITY_EXCEPTION stating Profile ID: id value of incorrect type: ...
0
votes
2answers
94 views

List all standard and custom fields for a given object (standard/custom object)

is there a way to list all the fields both standard and custom for a given object. tooling api - customfield gives only list of custom fields but not the standard fields.
0
votes
1answer
32 views

Adding new Fields to Sobject or changing field values dynamically

I have a Sobject Record which is already instantiated and fields are added along with values. sObject sObj = Schema.getGlobalDescribe().get(Name of Object).newSObject() ; sobj.put(...
0
votes
2answers
47 views

Lightning components - Initiating attribute with controller with multiples sObjects

I'm Working on Lightning components I would like to add some values in my App, by its controller (aura:handler) I'm trying with this : component.set("v.objetsCamping", tabObjets); But it doesn't ...
3
votes
1answer
72 views

Combining similar code with different objects

I have 4 very similar code blocks in a trigger that deal with synchronizing record type changes from Opportunity to its children. The only difference between them is that they do work on different ...
1
vote
2answers
91 views

Query regarding generic sObject and specific sObject

I was going through the 'Apex and Database basics' module in Trailhead and came across the following sentence in one of the units: This example shows how the generic sObject variable can be assigned ...
0
votes
1answer
55 views

Adding Additional Fields to a sObject in Apex, (just for manipulation)

I'm working with some complicated queries, and I need to send over http, the sObject in turn, but I can't make queries with more than 1 level of depth in the SOQL, so I am working with separated ...
0
votes
3answers
25 views

Adding a Custom Field to all sObjects in the same edit?

I want to add a custom field to all my salesforce objects, at the same time, a high level idea, is that they are control ID for an external source, but is there a way to add the fields to all objects ...
1
vote
0answers
132 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
59 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
454 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 ...