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.
607
questions
0
votes
0
answers
309
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
234
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 ...
3
votes
2
answers
204
views
What do I have to do in this case: List<Sobject> or Sobject?
I am beginner in Salesforce and I have to verify if the field Order.ShippingCountry is filled using the OrderId.
I would like to reuse this method below to fetch the Order.ShippingCountry. But I was ...
0
votes
1
answer
942
views
Unable to pass object Name in the SObject for loop to call methods Dynamically
I am trying to optimize my code, instead of using object Name in if else I want to pass the SObject parameter and combine below code
Instead of using separate objects I am trying to merge if else ...
0
votes
2
answers
3k
views
How to Type Cast Sobject List to custom object List in Apex to access custom object fields
Let's consider the below scenario:
I have a scenario to type cast sObjectList into the List<customObject__c> so that I can access customObject fields and store it into the following:
String ...
0
votes
0
answers
39
views
Make more visible icons on request
Is it possibile to make the icon and the pen in the layout more visible?
0
votes
2
answers
960
views
Apex Testing Error: System.QueryException: List has no rows for assignment to SObject
I am trying to get my test data set up for an Apex test class I made and I am getting "System.QueryException: List has no rows for assignment to SObject" in the tests error log. Not really ...
0
votes
0
answers
31
views
Apex List.add() always is null during test but works fine otherwise [duplicate]
Below code does not when I test via test class. I debug it I see the productPackges are all there but the IDs are not getting added to the Id list.
Code works fine if I deploy and test but just test ...
-1
votes
1
answer
687
views
Can I Convert Map<String,sobject> to Map<String,object> [closed]
I have Data in MAP<String,sobject> type map and I wants to put it in Map<String,object> type Map. Please help with this casting.
0
votes
1
answer
394
views
Skip Sobject that has an error during DML operation
I have a list of Sobject which I'm trying to update, but I want to skip those Sobjects that throw an error or more precisely those that have Sobject.addError('') during the trigger call.
i.e if I ...
0
votes
1
answer
2k
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 ...
4
votes
1
answer
493
views
Rest API query with FIELDS() does not return nextRecordsUrl
Goal: Get all Account records with all fields via REST API
Approach: Send GET request with query:
/services/data/v53.0/query?q=SELECT+FIELDS(ALL)+FROM+Account+ORDER+BY+Name+ASC+LIMIT+200
Problem: I ...
1
vote
1
answer
130
views
How to use jsforce to post to opportunity chatter
I am trying to use jsforce to post a message to the chatter section of a salesforce opportunity. I pieced the following together from watching how salesforce.com works, but it doesn't do what I want ...
11
votes
1
answer
942
views
Working with SObjects instead of concrete custom objects (i.e., abstraction in apex)
We have a bunch of custom objects, some of which implement a specific set of custom fields of the same type. (e.g., UniqueID, ExternalID, etc.). I want to be able to write one method that takes and ...
5
votes
1
answer
314
views
What is "Interaction Object State Definition"?
Just noticed this "Interaction Object State Definition" in the Classic Setup UI. Curious about what it is or will be (and Googling didn't help me). Links or description appreciated.
2
votes
1
answer
774
views
How to loop trough second level deserializeUntyped Json String [duplicate]
PLEASE NOTE: deserializeUntyped not deserialize!
I currently loop trough a jsonPayload which is working fine for the nodes of the first level.How can I achieve this for the node(s) of the second level ...
1
vote
0
answers
29
views
Missing sObjects on Tooling API [duplicate]
I was trying to query some entries using the Tooling API to get the SymbolTable from ApexClass/ApexTrigger. To do this I need to use the following sObjects (from Tooling API):
ApexClass;
...
1
vote
1
answer
1k
views
How to pass multiple input values from HTML to a SObject created in LWC
I have over 100 input field values in HTML that will be passed to a SObject created in the LWC JS. The SObject will be passed to the server side to persist data.
Every time there is a new input field ...
0
votes
0
answers
702
views
Is there any possibility to use custom labels inside Rich Text Area field in Salesforce objects?
Hi I want to know whether custom labels in salesforce can be used in rich text area field in salesforce objects ? If possible any suggestions or workaround to achieve the same functionality would be ...
1
vote
1
answer
529
views
How to get property from lightning web component based on button clicked
I have a dynamic lwc that generates related lists dynamically. I want to add a New button to the component but want to be able to dynamically get the component from which the new button was clicked so ...
0
votes
1
answer
1k
views
(Schema.SObjectType) || Method does not exist or incorrect signature: void
I'm trying to list the Record Types that a user has access to. Unfortunately, this cannot be done through SOQL Query (IIRC) and the only choice I have would be to either use Schema.SObjectType (Apex) ...
1
vote
1
answer
135
views
Sobject.isSet() not working with Trigger Sobjects
I'm having an issue with the Sobject method "isSet()". It works well if I query for a record or create a record outright. But does not work correctly for Trigger objects. On trigger objects, ...
0
votes
1
answer
463
views
How to skip files while refreshing full copy sandbox?
Not having a chance to exercise on production I need to recommend our administrator steps to initiate full copy sandbox refresh process. We would like to not to copy files from production.
Is there a ...
0
votes
5
answers
1k
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
1
answer
486
views
Access on UserDevice sObject
I am trying to query on UserDevice sObject but in the documentation it is mentioned "You must have View Devices enabled to see devices.". So can anyone please tell me how to do this to be ...
47
votes
6
answers
71k
views
Howto wildcard SELECT * to query all fields of objects in APEX?
I have created sObject and I need all the fields and I have many. Is there a way I can directly get all of them rather then typing each one of them.
3
votes
1
answer
180
views
Bug or feature: why SObject[] is instance of SObject?
Run this in Execute Anonymous
system.debug( new SObject[]{} instanceof SObject );
"compileProblem": "Operation instanceof is always false since an
instance of List is never an ...
1
vote
2
answers
641
views
Check field is updatable
I have object and field name, but don't understand how to check if that field isUpdatable. It gives me the error:
Variable does not exist: fields
SObjectType objectType = Schema.getGlobalDescribe()....
0
votes
1
answer
241
views
How to use variables in dot notation to find child relationship name?
Instead of teacher__c and student__c, they needs be dynamic variables. How can I substitute these API names with variables: parentApiName and childApiName?
for (ChildRelationship relation : ...
0
votes
1
answer
293
views
Queueable insert list records from map and keep order
I have Map with Account and Account Id. I want to insert that accounts in Queueable and return list of all ids in order as acount is inserted(Or map, it doesnt really matther). How can i keep order if ...
0
votes
1
answer
361
views
Custom REST API: get input, parse and upsert multiple records (including Parent record) [duplicate]
I am creating a custom REST API that receives as input the following structure:
Subscription record (main record)
Order Product record (Parent of Subscription)
I want to update the Subscription ...
0
votes
1
answer
313
views
Insert record from static resource csv
I have csv file with account records and want to insert that records via apex. How can i do it and dynamically find necessary fields? I can only manually assign them and its hard to parse cause of ...
0
votes
1
answer
433
views
Determine `SObject type` from relationship name without an exhaustive search
Consider a general relation 'Foo.Bar' and some SObject type. An example might be 'Account.Id' and an Opportunity.SObjectType.
Can I determine SObjectType Foo is referring to without getting the field ...
5
votes
2
answers
3k
views
Dynamic Schema getDescribe
I have two variables:
public String selectedObject {get; set;} //selectlist
public String selectedField {get; set;} //selectlist
public String selectedDataType {get; set;} //text
They are the ...
0
votes
1
answer
71
views
Insert record based on another record
For example a have account sobject and want to use record to create another record with mainly that record data. So same name and another fields, but some fields with another data. Is it possible to ...
0
votes
1
answer
2k
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/...
4
votes
1
answer
407
views
Why do Related Lists in SObjects serialize to JSON differently between Aura and REST APIs?
I have a custom object, Shift, that has a related list of Shift Breaks. I can query this data like:
List<Shift__c> shifts = [SELECT Id, Name, (SELECT Id, Name FROM Shift_Breaks__r) FROM Shift__c]...
0
votes
2
answers
362
views
Nested select record for each element in list
I have some List with values and i need to get record from sobject for each element from that list. So it looks like that. But its very close to limitations. Any ideas gow to do it? Its necessary to ...
0
votes
1
answer
842
views
Soql check if related record exist
I am using two sobjects Work__c with field name and WorkAssign__c with name,freeze__c and Work__c master-detail to Works sobject. Upd:
So i want to get first Work__c record which doesnt related to ...
0
votes
1
answer
376
views
Can we delete list which contains different SObjects with one DML statement?
I have List which can contains Accounts and Contacts ;
Can we delete the list using just ?
List<SObject> testList;
delete testList;
Can we delete list which contains different SObjects with ...
0
votes
1
answer
89
views
sobjects and related fields [duplicate]
How to get the account.name from the sobject?
I have tried getting the account itself but that doesn't work and debugging the map doesnt show the account name either.
list<opportunity> ...
0
votes
1
answer
51
views
Salesforce objects property
I am running a business in which I provide different services to clients. Now, which object is used for services in salesforce. suppose client want service from my company. Now the service I provide ...
0
votes
2
answers
1k
views
Get all object fields into map [duplicate]
I am trying to get all record fields and transfer them to another org. But getPopulatedFieldsAsMap doesn't give all fields. How can i retrieve all fields?
conList is trigger.new
for(List<Contact>...
-3
votes
1
answer
1k
views
Remove field from object list in class [closed]
I have list of accounts and want to use them for post request. How can I remove unnecessary fields like id to set that list in setbody?
Now I am just using for loop and json serialize.
Some code. So I ...
4
votes
2
answers
845
views
REST API Sobject GetUpdated/GetDeleted on sobjects returns The requested resource does not exist
I am trying to use the following -
http://www.salesforce.com/us/developer/docs/api_rest/Content/resources_getupdated.htm
On 'Document'.
Authentication and everything is successful, even calls to '...
3
votes
2
answers
2k
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
3
answers
9k
views
How to check if SObject has certain field?
I hope you'll help me to solve my problem :)
I've written a class that check if a Sobject has a field of a certain name
public static boolean hasSObjectField(String fieldName, SObject so){
return ...
1
vote
1
answer
46
views
Objects without layouts on some orgs
Several not long ago created org DO have these objects with layouts:
Example: Authorization Form -> Authorization Form Layout, Data Use Legal Basis -> Data Use Legal Basis Layout.
However, some orgs ...