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
0
votes
1answer
34 views

iterating sobject with Relationship Object Apex [closed]

I have two custom Objects Enroll_Family_Members__c and Family_Members__c. If the enroll = Y then I have to pass the recordId in Enroll_Family_Members__c table and Update the Fields, Else have to Pass ...
0
votes
1answer
23 views

Iterating sObject to fetch a field value using sObject.get()

I'm not able to get the sObject fields value in For loop. Getting Loop must iterate over collection: SObject, Can you help me what I am missing here sObject con = [SELECT Id, firstName, LastName FROM ...
0
votes
1answer
15 views

Can an SObject link to a file?

Is it currently natively possible to somehow have an SObject that links to a document, attachment, or salesforce file? Sure, you can always have a field that just includes the id of the object as text ...
0
votes
1answer
44 views

How to convert file to Document(attachment) in salesforce? [closed]

I have a requirement, My admin mistakenly converted some of the metadata attachments(document) to the files. Because of this system is not integrating with a third-party system. Is there any way to ...
1
vote
0answers
24 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'}; // ...
0
votes
0answers
42 views

Soql with multiple lookups on same object

I am gathering data from the LiveChatTranscript and there are multiple references to user as lookup fields. How do I pick which property I want to use as my reference to user? LiveChatTranscript ...
0
votes
1answer
21 views

Query on ApexPageInfo object to get created and lastedmodified fields

From salesforce setup i can acle to see all visualforce page name,createdby,createddate,lastmodifieddate and some other fields, I would like to get all the informations by writing query on ...
0
votes
2answers
44 views

updating reference field using generics sObject

I am trying to perform upsert on opportunity based on external Id. I am building the opportunity objects based on sObject as I am using that function for other objects too. Now Opportunity object ...
1
vote
1answer
40 views

Querying Salesforce Campaigns for Newly Added Contacts

I'd like to pull all of the contacts who have recently been added to a campaign using HTTP requests (from an external application). My current method is using a GET request with the URL /sobjects/...
0
votes
2answers
49 views

How can I assign field values from an Object instance dynamically via a predefined wrapping?

I have a Wrapper object that I'm using to store values via calculations and callouts. I want to map these values to a custom object's fields. I also have a custom metadata type where I'm storing the ...
0
votes
0answers
14 views

Unable to get related data in apex when using dynamic SOQL [duplicate]

I have a requirement where I have to query certain fields dynamically based on a string that contains the fields. However, when trying to obtain the values, I get 'Invalid field' error. A simple ...
1
vote
1answer
30 views

How to access SObject returned from web service?

So, I'm calling a web service via JavaScript: let opportunity = sforce.apex.execute("OpportunityWebService", "cloneOpportunity", {opportunityId: "{!Opportunity.Id}"}); The web service looks like ...
0
votes
1answer
13 views

Iterating Over the Sobject

Hi I need to to iterate over the sObject as --> Schema.PicklistEntry for this i have created the for loop to iterate over it but getting below error, can anyone help me out for this. {`List<...
0
votes
1answer
42 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 ...
1
vote
1answer
16 views

Way to provide complex unique restriction

Let's say we have custom object with 2 key fields. How can I provide complex unique index to avoid interactive inserting records with the same values in this fields?
0
votes
0answers
17 views

Create a list of accounts and access their fields

I am tackling a Salesforce APEX - problem which is probably quite straight forward but I can't figure it out: I have extend the code from https://developer.salesforce.com/docs/atlas.en-us.pages.meta/...
1
vote
1answer
96 views

How to make the “Activity” tab appear for Customer Community Plus Users?

I have Customer Community Plus users set up and have used contact shares to grant access to the appropriate contacts. On the contact detail page, however, the "Activity" tab is missing. When I assign ...
1
vote
1answer
31 views

How to find a sobject used in which apex class

How to find which object is used in which apex class or trigger.Ex I want to find apex classes where account object is used.
0
votes
1answer
21 views

Building out a multi-dimensional array / list for an update statement

I have a contact list I am looping over and one of the fields in the contact object holds 1 or more contactIDs in a delimited list using a carriage return. Standard Contact Object: ContactId: ...
1
vote
0answers
34 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 ...
0
votes
1answer
20 views

Filter Object Queries Based On Profile Name

So, as the title says, I would like to find all the records of an object that have been created by OR are only visible by a certain profile. Here is a query I have tried SELECT Id, Subject, ...
0
votes
0answers
29 views

Account Related List Not Showing Up

I am trying to add an account's related list to the Contact page layout. It will show up for me in Classic and Lightning, but ONLY me, as I am a sys admin. The other profiles have to go to classic ...
1
vote
1answer
43 views

SObject key of map mutated returns null but serializing returns the value

I am using a SObject as a key and mutating it. When I try to get the map value using the sobject, I get null. However, when i serialize the value, I can see the old value stored. Can anyone clarify ...
0
votes
1answer
57 views

How to make a Json object a subclass

I have a Json Object which I created with the online JSON to apex tool. This works a a separate class how can i make this a subclass. I get the error: Inner types are not allowed to have inner ...
0
votes
1answer
50 views

How to loop trough subquery and fill fields in array Json object

I have created a custom object to create a json string. I kan loop trough the list to fill in the first level/parent fields. How do I loop trough the subquery and fill the arrays in the json object. ...
0
votes
1answer
53 views

Can't save Object from API as new contact in lightning component

I need to save the data filled through API as a new Contact but i receive the follow msg when i press the "save" button: This page has an error. You might just need to refresh it. Action failed: c:...
1
vote
0answers
32 views

SObjectCollection in Composite request limits

According to the composite API documentation, "You can have up to 25 subrequests in a single call. Up to 5 of these subrequests can be query operations, including Query, QueryAll, and “Query More” ...
5
votes
1answer
205 views

Mocking SObjectType to make tests independent of 3rd party managed packages

When unit testing code that interacts with SObjects in other managed packages, being able to mock those SObjects would be helpful so the packages don't have to be installed to run the unit tests. The ...
0
votes
2answers
28 views

SOQL statements cannot query more than 20 different child types error

I have the following piece of code public static void fetchRelatedRecords(String primaryRecordString){ SObject primaryRecord = (SObject)JSON.deserialize(primaryRecordString, SObject.class); ...
0
votes
1answer
132 views

How to get child relationship name from Parent Object in Apex

In the following piece of code, i am trying to do a dynamic parent - child query public static void fetchRelatedRecords(SObject primaryRecord){ String recordId = (String)primaryRecord.get('Id');...
0
votes
0answers
24 views

SObject Get Updated - Only look at specific fields

Is there any way to specify the list of fields that will influence whether a record will be returned by an SObject GetUpdated call? ie all records that have a specific field modified since last ...
0
votes
2answers
151 views

Data Replication Api

I'm building a data replication system using SF Rest API. I see quite a few different ways to reach my goal. Can somebody highlight the differences between some of these possibilities and provide ...
1
vote
1answer
47 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
198 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
30 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
69 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
55 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
130 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
37 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
54 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
56 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
67 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
85 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
99 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
29 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 ...
5
votes
1answer
604 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
367 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
207 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
67 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
41 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 ...

1
2 3 4 5
10