Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

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
219 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 ...
Uwe Heim's user avatar
  • 28.4k
3 votes
1 answer
3k views

How to use inner class / wrapper class as scope in Apex Batch

I already successfully collecting the list of data from callout another system as json body to the inner class to accomodate custom information: Here is the apex class of the inner class: public ...
Rival's user avatar
  • 601
3 votes
1 answer
557 views

How to use a Fieldset with an arbitrary sObject in Visualforce?

Working from the fieldsets section of the Visualforce Developer's Guide, I can build a table based on a fieldset for a given sObject type, for example (error handling elided for clarity): // ...
Jason Clark's user avatar
  • 11.9k
3 votes
1 answer
2k views

Is it possible to assign a field value as a key for a Map query

I am wondering if it's possible to create something similar to this: Map<sObject.field, sObject> mapOfsObject = new Map<sObject.field, sObject> ([ SELECT field FROM sObject ]); I ...
Arthlete's user avatar
  • 4,907
3 votes
1 answer
415 views

repeat inputfields dynamic dependent on list of string

I have an sObject custom_obj__c with a multi-select picklist field items_list__c and its values (items) are (item1 list, item2 list, item3 list,..), and checkbox fields (item1_list__c, item2_list__c, ...
user3003810's user avatar
3 votes
1 answer
75 views

problem with sObject as parameter

I get the below error when I try saving CLASS 1 below. The second class that is the problem is also below. I obviously don't understand objects or apex well, so any help would be greatly appreciated. ...
cathy's user avatar
  • 31
3 votes
1 answer
1k views

Fetching SObject Id from changes in Lookup fields using History tracking

I have set history tracking for my Custom Object and set a Lookup field for my referenced Object. CustomObjectX_c[Field1,Field2,Account_c] Here Account__c is a lookup field to the Salesforce ...
karthikselva's user avatar
  • 2,476
3 votes
3 answers
3k views

SOAP API Request with body larger than 16 Kilobytes results in Timeout Exception

I stumbled upon an interesting limitation, it seems that SOAP API endpoint handles requests larger than 16Kb differently --- whenever body is larger than that request just times out. We're using '...
antonlitvinenko's user avatar
3 votes
1 answer
1k views

Possible to get sObjectName in Utility Bar LWC?

I'm creating a LWC that I want to have context from the currently focused tab. I want to have both the recordId and the sObjectName. In fact, I've successfully done this for the recordId based on this ...
jbyrd's user avatar
  • 641
3 votes
2 answers
3k 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 ...
626's user avatar
  • 273
3 votes
1 answer
82 views

SOSL on Permission Sets error when no ID is included

I am testing SOSL's on Permission Sets for something I am building and noticed that if I don't include the ID in the fields to request, the search fails: An unexpected error occurred. Please ...
glls's user avatar
  • 20.2k
3 votes
1 answer
273 views

Can a Web Tab's url be get and set from Apex or the REST Api?

I would like to modify the url of my Web Tab for each SF organization that my managed package is installed on. Is there a way to get and set the url of a Web Tab from Apex or the REST Api? Is there a ...
edgartheunready's user avatar
3 votes
1 answer
6k views

"New Action" vs "New Button or Link" for a custom object

A custom object's setup page has a section "Buttons, Links, and Actions". I've created buttons and links in the past, but do not remember the "action" option being there. Can anyone explain what "...
Keith C's user avatar
  • 136k
3 votes
1 answer
946 views

Query for 'Lead' object is not returning a Converted Account ID

I am using the following JSforce command to get a specific lead: jsobject('Lead').find({ Phone:number})... The problem that I am running into is that I am getting data returned, but it seems to be ...
Yuki Tokuda's user avatar
3 votes
1 answer
51 views

Are SObjectField tokens safe in cross-managed package calls?

We have some code and SObjects and fields in a managed package that works when executed by other calls in that managed package as your would expect. The code looks like this. private SObjectField ...
Keith C's user avatar
  • 136k
3 votes
1 answer
310 views

Issues with a Query within the main Query using DatabaseDotcom Ruby gem

I'm having a issue with pulling the data out of what would be a array of object data in my SFDC query. Im using the databasedotcom gem. Code def self.data_query #@client is defined at a class ...
Jaison Brooks's user avatar
3 votes
1 answer
183 views

Insert sObject share for task that the user doesn't own

As a regular user (not system administrator) is it possible to create a share for a object that I'm not the owner of in APEX? Or will the DML statement throw an error?
jordan.baucke's user avatar
3 votes
0 answers
704 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 ...
Christoph's user avatar
  • 1,022
3 votes
0 answers
1k 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 ...
Pranay Jaiswal's user avatar
3 votes
1 answer
815 views

Aura Attribute of Type Object is Supported in Flows?

I am working on a Flow Screen and trying to assign a value to a lightning component attribute from a variable in the flow. The flow screen allows me to select the lightning component but it doesn't ...
Bruno Lauris's user avatar
3 votes
0 answers
100 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 ...
Patlatus's user avatar
  • 17.1k
3 votes
1 answer
99 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. ...
Bart Juriewicz's user avatar
3 votes
1 answer
2k views

Compile Error: sObject type 'Custom__c' is not supported in Managed Package

I'm creating an apex class that implements Schedulable and in the execute it queries a Custom Object but I can't understand why I'm getting this error when trying to query. Some other related ...
Jose's user avatar
  • 2,142
2 votes
1 answer
3k views

Why does Salesforce automatically put the record Id in the Name field?

When I create an object, it automatically creates a name field. And when I want to create any record for this object from Salesforce create new button, it's okay. Record created. But when I tried to ...
Rajiv's user avatar
  • 21
2 votes
1 answer
1k 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 ...
Thomas's user avatar
  • 2,298
2 votes
2 answers
3k views

Delete an SObject by knowing only Id

Is it possible to delete an SObject by knowing only Id? Here is what I found: Id del = '003S00000099999'; // whatever ID you are deleting Contact ct = new Contact(Id = del); delete ct; So, is it ...
iloveseven's user avatar
  • 1,115
2 votes
1 answer
6k views

Create one table of multiple object types

I am looking to create a table, for instance pageBlockTable, with entries from multiple object types. The various objects share some fields, and also have unique fields. The table should display a set ...
Chuckels5584's user avatar
2 votes
3 answers
5k views

System.QueryException: List has no rows for assignment to SObject

following apex code public String getLastUpdatedAt() { String timeStr; DatadoctorStatus__c last = [SELECT LastUpdated__c FROM DatadoctorStatus__c ORDER BY LastUpdated__c DESC LIMIT 1]; if (last == ...
Bhushan Lodha's user avatar
2 votes
3 answers
2k views

Considerations for Map Keys with Trigger.new records in Before Insert Context

I have a scenario where, on insert of Events (Activities), I need to insert records related to the Events, and then tie them back to the Event by populating a custom field on the Event object with the ...
Morgan Marchese's user avatar
2 votes
3 answers
904 views

Can't set property value for SObject using setType function

I'll get my excuses in early: I'm a developer with some experience of working with APIs, but this is my first encounter with Salesforce. We've been given a spec to interface with a customer's ...
KenD's user avatar
  • 123
2 votes
3 answers
6k views

How to access lookup object field in apex

So, I'm getting the values of the properties of a custom sObject in my org, in an Apex method. So, this is how it works, basically I receive via parameter a list of strings that are the fields that I ...
joacoiudica's user avatar
2 votes
1 answer
3k 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 ...
unidha's user avatar
  • 2,552
2 votes
3 answers
12k views

Retrieve object type via id using apex

I am new to Salesforce and trying to figure out the object type using the ID which I see in the URL on the Salesforce page. I found many places describing how to do this with the Apex language, such ...
user1015214's user avatar
2 votes
1 answer
56 views

Trigger on Single Field

I was playing around with Apex Triggers and was wondering, suppose I had an object (for example Account), which contains a sub-object (such as the string BillingAddress). Can I set a trigger on ...
Sidharth Ghoshal's user avatar
2 votes
1 answer
3k views

How to check that SObject field is present in SOQL query

When you try to attempt to the field that not present in SOQL query, you get error like that: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: ...
Gres's user avatar
  • 391
2 votes
1 answer
1k views

Date Json.serialize removes 00:00:00 digits from datefields of object

I have the following object (invMappingNew): {customerId__c=1, addressId__c=8212BJ154, invoiceType__c=AdvancePayment, invoiceTypeLocalized__c=Voorschot, invoiceDate__c=2015-02-13 00:00:00, ...
Thomas's user avatar
  • 2,298
2 votes
2 answers
94 views

Embedded VF Page Not Responding To StandardController

I am trying to embed a custom VF page into my Accounts layout. I believe my error is in the standardController. I assumed it should be SObject but it did not work and now I am not 100% sure what it ...
Olivia's user avatar
  • 3,461
2 votes
3 answers
214 views

Invalid field for SObject using nested SOQL Query

Trying to create a list of Open activities so that I can sort and display as an apexDataTable on a VF page. I'm currently seeing the error: Invalid field Subject for SObject Account VF Page ...
LFitzer's user avatar
  • 25
2 votes
1 answer
4k views

List has No Rows for Assignment to SObject: Error

I have below trigger code where I get "List has No Rows for Assignment to SObject" Apex trigger: trigger CallVisibility on Compliance_Incident_Transaction_abv__c(before insert, before update) { ...
Testing_SFDC's user avatar
  • 2,940
2 votes
1 answer
605 views

Can standard field "Name" for sObject be longer than 80 Characters?

Question is the title of this question...or do I have to use a custom field?
jordan.baucke's user avatar
2 votes
1 answer
3k 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....
Eduard's user avatar
  • 5,139
2 votes
1 answer
4k 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 ...
Matthew Metros's user avatar
2 votes
1 answer
71 views

How can I abstract building maps from SObject Lists in a good way? [duplicate]

I frequently find I want/need to map a list of SObjects by a value other than it's own Id. So, I'd like to abstract this process to make it reusable. For example, I might want to map Contacts by ...
Brian Kessler's user avatar
2 votes
1 answer
180 views

Which sobject stores the FieldPermissions for a profile.?

For a ProfileSet I see that field permissions are stored in the FieldPermissions sobject. Does anyone know which sobjects stores the FieldPermissions for a Profile? Thanks in advance
user2324723's user avatar
2 votes
1 answer
178 views

Standard SObject which are not exposed by Salesforce

I would like to know if there is Standard SObject for Changeset or Package? I noticed that 033 is prefix for Package and 0A2 is key prefix for Changeset. However, neither of there objects are not ...
Patlatus's user avatar
  • 17.1k
2 votes
2 answers
2k views

Sobject put set value of managed field in case of same field api name as unmanaged field

We are developing a managed package that contains a custom object and a REST API to do CRUD operation on that object. We are not using standard salesforce REST API for valid business reasons. In this ...
Amit Jain's user avatar
  • 827
2 votes
1 answer
762 views

How to create object by it's name?

I'm writing a REST service which calls external service. I want to write a test for my service. I came up with no possibility to mock this call as it's in managed package. I want to wrap this call ...
Andrii Muzychuk's user avatar
2 votes
1 answer
263 views

Is it possible to get valuetypes of fields of a JSON object without using getGlobalDescribe() [duplicate]

I have the following piece of code to get the valuetype. Is it possible to do this with getSObjectType() instead of getGlobalDescribe() since this is a lot slower. Apex Map<String, Object> ...
Thomas's user avatar
  • 2,298
2 votes
1 answer
426 views

Attempt to de-reference a null object when using alternative to getGlobalDescribe

In the following code String myString = 'Account'; SObjectType sObjType = ((SObject) Type.forName(myString).newInstance()).getSObjectType(); When myString = a object name does not exist i get a ...
Vneq's user avatar
  • 79
2 votes
1 answer
3k 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 ...
Tom's user avatar
  • 106

1 2 3
4
5
13