Hot answers tagged

11

An SObject represents a specific table in the database that you can discretely query. The API Name is what you reference as ending in __c. Standard SObjects have names like Account or Opportunity, whereas Custom SObjects and Custom Settings have names like MyObject__c or MySetting__c. Custom Settings are special objects you can get without a query. You can ...


10

You can define the object name with text type or autonumber If you select Text then you can manually enter value in name field. If you select Autonumber then Name field will be generate automatic. For auto-number fields, enter a Display Format to control formatting details such as the minimum number of leading zeros and any prefix or suffix for the number....


7

You can use Force.com Eclipse IDE to get all standard and custom objects using the RMB Project | Add Remove Metadata Components then use the Search command on the field name to find the object


7

You can easily do this using Global Describe map<String, Schema.SObjectType> GlobalMap = Schema.getGlobalDescribe(); for (Schema.SObjectType Obj : GlobalMap.values()) { Schema.DescribeSObjectResult ObjDesc = Obj.getDescribe(); system.debug('Object Name: ' + ObjDesc.getName()); } System.debug(GlobalMap.size() ); Or if you want to see only ...


6

Yes they are unique. You can always copy the 18 character ID and paste in URL after like this: http://instance.salesforce.com/{ID}. And you will go to record since they are globally unique.


6

A quicker way to do that is to use describe call in Apex. System.debug(Contact.FirstName.getDescribe().length); //Prints 40 System.debug(Contact.LastName.getDescribe().length); //Prints 80 It also works for All fields standard and custom. That being said, you can use global describe to get lengths of all fields. Src : https://developer.salesforce.com/...


6

method named accountsByState that accepts a state abbreviation as a string and returns a List of Account objects You are not passing the parameter for state. public static List<Account> accountsByState(String stateAbbr) { return [SELECT Id, Name, BillingState FROM Account WHERE BillingState=:stateAbbr]; }


5

There are lots of ways you can do something like this, but the most important thing to consider first are what the other requirements of the application will be. Will all of your employees be Salesforce users? For the purposes of this answer, I will assume yes. Will the feedback on candidates be largely unstructured (comments only) or will there be ...


5

You need to create a Wrapper class for this. Example : public class TestWrapper { public static void pushValue(){ list<fieldWrapper> n = new list<fieldWrapper>(); fieldWrapper f = new fieldWrapper(); f.key = 'a'; f.label = 'b'; f.property1 = 'c'; n.add(f); system.debug('DD'+n); }...


5

The snippet you posted in the comments is failing due to a common mistake. Its an order of operations error, because you're adding an extra string to your comparison, it gets merged into your string value, and screws up your comparison. Your code is evaluated like this: '==>' + 'ab' == 'ab' ('==>' + 'ab') == 'ab' '==>ab' == 'ab' // false If you ...


5

you can check details about fields on Contact SOAP API guide FirstName - The contact’s first name up to 40 characters. LastName - Required. Last name of the contact up to 80 characters.


5

You can use the CDC (Change Data Capture) to get updates only on updated fields. You could also write manual code (Apex) to create a change delta, although this might require a lot of CPU time depending on the number of fields involved.


4

If you are talking about a quick select rather than typing all the fields, Workbench is the best tool for me. You can navigate into query > soql query and from below view you can select all the fields easily and the results are shown in a usable manner.


4

A common direct use of the SObject class is when writing Apex code that you want to work with various actual types e.g. something that works with Account and Contact and any other standard or custom object. For example you can call myMethod here using any type: Account[] accounts = ...; Contact[] contacts = ...; myMethod(accounts); myMethod(...


4

The overall answer to this is that there is an Apex Batch Handler which controls batch class execution. You could think of it like a method that calls your start method, then launches threads which call your execute method and handles the result of those threads, and finally calls your finish method once all execute threads have completed. With this in ...


4

Public Group API Name is Group and to add members use GroupMember. In Dataloader, if Group does not display in the default list, check Show all objects to see a complete list of objects that you can access.


4

No, with SOQL it's not possible to access meta data on the object you are quering. Actually, I don't see any reason why would you need working with metadata using SOQL? Nevertheless, you can easily do this with APEX, and then query records if needed. Here is documentation on the classes you may use to obtain necessary information. Understanding Apex ...


4

Apex is strongly typed, which means that it has to know in advance what type of data it's dealing with. In this specific case, you could have just passed in an Id: public static void changeProgram(Id recordId) { In the more general sense, you can pass in a Map, which is as close as you get to a JavaScript object: public static void changeProgram(Map<...


4

Salesforce has introduced Consumer Goods Cloud, a new industry product that enables companies related to consumer goods to optimize revenue growth and maximize ROI with the help of advanced retail technique adoption. Image Object is available in API version 47.0 and later. Image Object Consumer Goods Cloud


3

The root cause of your issue is that you're assigning the result of a list into a singleton, and when there's no values returned, a QueryException is thrown. See these alternatives: 1) try { String ATL= [select Territory_vod__c from Account_Territory_Loader_vod__c where Account_vod__c=:o.Call_Account_abv__c limit 1].territory_vod__c; } catch (System....


3

You have to relax permission at profile level. If the user does not have permission he will not be able to edit the record Sharing model allows access of records to non-owners, and non-owners must have that access at profile level.


3

Although you have setup your sharing rule with Read/Write access, you need to apply the correct levels of Permission at the Profile level. Sharing will provide you access to record level whereas profile provides access on object level. Sharing rules will grant Read or Read/Write dependant on the users Profile access. Take a look at Adam Tormans response on ...


3

What you're looking to do isn't a simple conversion from String to Boolean, what you're trying to do here is to take a String and execute it as an expression, like Javascript's eval() function. That's an entirely different beast (than variable casting), and not one that Apex is meant to handle. There are some similar questions that pop up from time to time,...


3

This code will do what you require: req.setBody(JSON.serialize(new Map<String, Object>{ 'left': leftFileParameters, 'right': rightFileParameters, 'common': commonParameters })); For more information, See the JSON.serialize method documentation. That method can work on maps and so the above code creates a map to hold the other maps. You ...


3

You can modify the fields that you see in the search. But you cannot add more than 2 fields (secondary field) in the results. The secondary field is configured in the Search Layout for the object and is displayed on lookup fields. From documentation for Lookup Search in Lightning Experience What Determines the Secondary Field Under the Record Name? When ...


3

Click on that ☶ Field Set Properties button next to Save, Cancel, ↶ Undo, and ↷ Redo.


3

For some isolated cases - yours is one of them - there is this (ab)use of the serialize methods: Invoice inv = (Invoice) JSON.deserialize(JSON.serialize(new Map<<String, Object>{ 'Ref' => 'REF123' })), Invoice.class); Here, the capability of JSON.deserialize to create an instance of the specified type and set the properties of the instance ...


3

If installation requires the ContactsToMultipleAccounts feature to be active then the destination org will have to enable prior to being able to install the package. All standard dependencies work like this. If the org does not have or will not enable then they cannot install the package. As for the version numbers and unlocked packages, they are a ...


3

Limitations of Apex Replay Debugger in VS Code https://developer.salesforce.com/tools/vscode/en/apex/replay-debugger This is under the "Considerations" section. I don't even think using checkpoints helps this either. I simply continue to utilize System.debug() when I'm testing an issue like this with maps/lists.


3

Presuming that this came from a server call, you need to copy the objects entirely: let tempFieldWrapperArray = this.fieldSetWrapper.fieldWrappers.map(element => ({...element})); Or: let tempFieldWrapperArray = this.fieldSetWrapper.fieldWrappers.map(element => Object.assign({},element)); This is because the entire response is locked behind a ...


Only top voted, non community-wiki answers of a minimum length are eligible