An sObject represents an object, such as an Account or Campaign. An sObject is the base object for all objects in Apex.

learn more… | top users | synonyms

0
votes
1answer
23 views

N>Help with Passing Values from one Object picklist to another Object text

I have 3 objects Contact, mList and mEvent. mList is a junction object which has master-detail relationships to both Contact and mEvent. The mEvent has a picklist field called Group_Level__c (values ...
2
votes
3answers
45 views

Convert SObjects containing child/parent records into a map

How can the following list of records be serialized/deserialized into a map or collection? Account[] accs = [select id, name, custom_parent__r.name, (select lastname, firstname from Contacts) from ...
3
votes
1answer
42 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, ...
0
votes
1answer
12 views

Compile Error: Constructor not defined: [ApexPages.StandardController].<Constructor>(List<Partner__c>)

I'm trying to write an apex test class for my apex (extension) of my visualforce page which display list of partners from partner__c sObject and do some actions on its rows like edit and delete. ...
0
votes
4answers
42 views

Displaying Related List on Custom Object: SObject row was retrieved via SOQL without querying the requested field

Any help would be greatly appreciated (either in actual code help or pointing me in the right direction). I'm not much of a developer but was trying to get a related list from a custom object to ...
0
votes
0answers
28 views

Help with class and VisualForce page (sObjects)

Hi I have a seemingly complex requirement regarding multiple sObjects and a VisualForce page. Requirement: There are 3 custom objects ItsApproved_Booking__c (related to the Opportunity object) ...
3
votes
0answers
67 views

Bad rightOperand type: got SObjectScriptRow

I just want to know what is SObjectScriptRow! All I can find about it is this question. I'm building an invocable method to be used from a process, where I have one input parameter: a list of an ...
2
votes
1answer
29 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 ...
2
votes
2answers
58 views

Cast a Map <Id, sObject> to Map <Id, Opportunity>

I'm trying to implement the trigger framework outlined here: The triggerhandler methods take lists or maps of sObjects as their inputs. In his example he casts list <sObject> as list ...
3
votes
1answer
24 views

Get a deleted record using SObject Rows returns “The requested resource does not exist”

I'm using the SObject Rows API to get the fields values of a given record. It works fine on existing records but when used on deleted records it returns with an error of ...
0
votes
0answers
21 views

Trigger Invite email when creating new users through REST API

I am new to salesforce development. I have successfully implemented salesforce REST API and was able to create a new user. However user is not getting invite email. I have gone through several ...
0
votes
0answers
22 views

Anonymous behavior custom object access field change

There is a trigger that will create a Case Comment (custom object case comment record) if a custom object record is created and it works fine. But what happens is when a record status is changed ...
9
votes
2answers
148 views

Case-Insensitive Maps?

How is it that describes seem to return case-insensitive maps? For instance, if I create a new custom setting, the following succeeds: Map<String, SObjectField> fields1 = ...
1
vote
1answer
24 views

How to update reference field in sobject

I'm trying to update a sobject (CollaborationGroupFeed) via apex, but I am unable to update a particular reference field (in this case: CreatedBy). Here is my code: CollaborationGroupFeed cgf = ...
1
vote
2answers
20 views

Dynamic formula field

How can i use dynamic field value in the formula field. Like :- TEXT(contact__r.Contact_Title__c) I want to deploy this formula field in my org without creating Contact_Title__c field on contact ...
0
votes
1answer
29 views

Value an object with a map<String field, String value>

I am developing an apex code to scan an email and use some values i can found. I have a custom object used to map the labels to existing fields. Then i have a map with field names and values. I would ...
0
votes
1answer
47 views

How to assign an Account Name on an Opportunity Test Class

I am creating a @testClass for an Apex Trigger I wrote with the intent to automatically set an Opportunity Checkbox field to False, if the Opportunity was cloned. (The Else statement also defaults the ...
0
votes
1answer
32 views

Retrieve the records as a picklist when an SObject is selected from another picklist

I have a requirement where I need to display all the SObjects as a picklist. When the SObject is selected, another picklist having the name of the records of that particular SObject must be displayed. ...
1
vote
1answer
37 views

MiddleName Field cannot find in in “.fields.getMap()”

We've just enabled the Middle Name and Suffix Fields feature and encountered the below issue. SUMMERY : Just after enabling "Middle Name and Suffix Fields", Implementation of custom apex logic in a ...
1
vote
1answer
116 views

recalculateFormulas() causing UnexpectedException: Unable to create/update fields: IsDeleted

When I update my custom Record__c a trigger runs, and it calls recalculateFormulas() on the record. This results in the following error: System.UnexpectedException: Unable to create/update fields: ...
1
vote
1answer
34 views

What is the fastest way to update a field on thousands of records?

I need to create a new checkbox field on an SObject, and I would like the original value to be true. Setting the default value of the field to true only applies to new records. What is the fastest ...
0
votes
0answers
12 views

Alternative way of finding the Report type

I need a little help with Reports. I get the report metadata in JSON, but the returned reportType is not meaningful enough to me so I can tell for sure for which Objects is the report. Here's sample ...
2
votes
2answers
124 views

Get all Button who have used JavaScript

Is there any way to find out all the Button in org who have used JavaScript in it. Or Lets make it more simple - How can I get List of all Button in sObject. (Where also I can differentiate ...
0
votes
0answers
28 views

Updating Existing Records in Flow

I have what seems to be a simple issue but I cannot solve it. Here's the scenario: A custom record "Buildings" is created - this is via an import but not relevant to my Q. Once the record is created ...
2
votes
1answer
36 views

Is that possible to write dynamic code for Salesforce SOAP to use object like map?

For regular SObject, I can run the following code: static void x(Map<String, String> fieldValuesMap) { SObject so; for (String key: fieldValuesMap.keySet() ) { so.put( key, ...
4
votes
1answer
125 views

How to see the entire resultset in the debug log instead of (n more)?

Good Morning, Thanks in advance for reading. Is there any way to display the whole sObject in the resultset returned by SOQL query instead of the (n more) below e.g. 30 more, 22 more etc. ? I am ...
2
votes
1answer
43 views

How to use a Dynamic List Type of SObject getted by ID

I'm trying to do a Dynamic List of a SObject gutted from an ID. My goal is SEND a SObject info via mail. (Opportunity, Case...) From a list of selected records, I send by argument their IDs with ...
0
votes
1answer
23 views

How to add SObject to an SObject Collection in Visual Flow

I have a flow that loops through a few collections and eventually brings me to a point where I have assigned an SObject a set of variables. Then I want to add that SObject to a new collection for fast ...
0
votes
2answers
64 views

Unit Test Fail - list has no rows for assignment to Sobject

Good Afternoon, I am running my test class and i am getting the following error message. Class.DM_MarketingCloudPolicyController.getPolicy: line 43, column 1 ...
0
votes
1answer
45 views

How to check access of user for particular user on object

How do I check the access of current user on particular object dynamically. I have a custom mapping object in that I am storing object name in the string. I want to check Whether the current user has ...
3
votes
3answers
145 views

How to export object with their field-level securities and/or how to set all fields securities levels at once?

My team and I are working on a project together using lighting components and a lightning app. Each one of us have our own Salesforce developer edition orgs. We use "Force CLI" to fetch the code to ...
2
votes
0answers
15 views

Capitalization guidelines for Salesforce objects in managed package application UI

Can anyone suggest guidelines for how to capitalise references to Salesforce objects in a managed package application UI, in particular standard objects like Account, Contact etc.? I've read the ...
1
vote
2answers
80 views

Getting null value from standard getter method of sObject

I am stuck in a very strange situation. I have one custom object (test_Boolean__c) and a field of checkbox type (check_Boolean__c) whose default value is true. Now this is what I did :- Created a ...
0
votes
1answer
50 views

Update a record to its default values[MetaData]

I want to refresh a record to the default values that we used while creating those fields ie in metadata. My object has around 100 fields, so manually searching and doing it is troublesome. I can use ...
0
votes
1answer
82 views

Incompatible value type id for Map error

Anyone know why this keeps throwing an error? list<Account>Dealerships = new list<Account>(); map<Id, OpportunityLineItem> Opp2Deal = new map<Id, OpportunityLineItem>(); ...
4
votes
2answers
76 views

Utility Method Returning Different Type (Set instead of List)

Previously I had posted this question awhile back: Utility Methods flexible enough for all sObject Types Now I want to expand my method a bit to return a Set<Object> instead of a ...
-1
votes
1answer
34 views

How to query another Objects field to get it's value

How do I query the value of Contact.Country__c? It is to be connected with Case. For now my code is: @isTest public class WebToCaseCountryTest { public static testMethod void testTrigger() ...
1
vote
0answers
145 views

How to clone record with its related list using custom clone list button in Sobject?

Clone record with its related list and update the picklist value i have created one button on record top beside the clone button, when clicked, execute code that would make a new version record with ...
0
votes
2answers
49 views

Using getSobject to fetch the parent Account of an Account

I would like to dynamically fetch the parent Account of an Account in a similar fashion to the way it's done in the selected answer to this question. However, this doesn't seem to work in this case. ...
1
vote
1answer
179 views

How to compare two sObjects from 2 List<Lead>()?

I'm in need of a way to see if changes were made to a reference of an object, and compare to the original values. This is independent of the trigger context variables such as oldMap + newMap. Is ...
0
votes
1answer
36 views

How to render a value to string which is coming from sObjcet Long Text area in saleforce Apex Class [closed]

I have a sObject which has a Long Text Area field "Account_Id" which contains , "'Account Name'+Account.name" but when i want to replace "Account.name" value from my Apex class than i am failed. e.g. ...
1
vote
1answer
69 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) { ...
3
votes
0answers
46 views

Change sObject field type and deploy with API

in this thread, there is a discussion about modifying custom sObject's type. When I try to change the field's type in Salesforce GUI, indeed I can see the error message about some references in code. ...
1
vote
1answer
54 views

Javascript query not finding existing field

There is some small work going on with a custom javascript button in an org that I do not have Admin access to. It fails on a field that clearly exists. ...
0
votes
1answer
287 views

Dynamic SOQL for getting all objects in Salesforce Org

I am creating a VF page which contains a Picklist of all objects in my Salesforce org including Custom Objects. I am getting an error 'unexpected token: 'null' when I select custom object. VF Page ...
1
vote
1answer
46 views

Attach Files to sObjects that don't offer standard support for it

I'd like to give users the ability to attach files to the Opportunity Product sObject which doesn't inherently support file attachments. How do I add that ability?
3
votes
1answer
302 views

How to use addError() with a dynamically derived field name? [duplicate]

I know I can add an error to a field as follows: Account someAccount = [select id, name from Account limit 1]; someAccount.name.addError('Bad Name'); How can I do that if the field name is only ...
1
vote
1answer
173 views

Getting field value dynamically while using describefieldresult

What I have to do is to get all fields of an sObject and converting it into xml runtime. I have all the fields. And I get field name and field label in xml tag. What I want is field value instead of ...
2
votes
2answers
123 views

Enterprise WSDL maps objects to different types in different organizations

I have two organizations, one for development and another for production/sandbox. When I generate an enterprise WSDL from production/sandbox I have some lookup relationships mapped as Name. When I ...
1
vote
3answers
745 views

Is it possible to retrieve picklist values from SalesForce using SOQL?

I am using a .NET library - SalesforceMagic - for communication with SalesForce. I use a SalesForce API user credentials and pass data to and from via a SOQL query. It all works fine. Now, there are ...