Get the type (data type) of a field in apex
Using Describe Method: Consideration Notes: Just a query – After Spring 20 Consideration Notes
Using Describe Method: Consideration Notes: Just a query – After Spring 20 Consideration Notes
Most efficient way of identifying the type of org (Production or Sandbox) via Apex code: Actually we can query this detail from Organization object as below: On the top of this, we can build our own service method like below:
Apex Code Snippet to Convert Blob into String Apex Code Snippet to Convert String into Blob
Check on the profile for the user. Access the profile settings in order to verify that API is enabled as well. In LEX, go to Set up | Users | Profiles. In Classic, click Setup | Administration Setup | Manage Users | Profiles. Select the profile that you need to check, and under “Administrative Permissions” verify if API Enabled is selected.
The following sample code approves records in mass using apex. Below example just uses Account object’s record. Please feel free to update it as per your need.
You can use the PageReference.getContentAsPDF() method in Apex to render a Visualforce page as PDF data. Then use Apex code to convert that PDF data to an email attachment, a document, a Chatter post, and so on.The following example is a simple three element form that selects an account and a report format, and then sends the …
Feel free to utilize this method and change as per your need:
The error “List has no rows for assignment to SObject” occurs when query doesn’t return any rows. Resolution While a SELECT normally returns an array/list, these statements are using the shorthand syntax that assumes only one row is returned. What’s not obvious is that it also assumes that exactly one row is returned! Although this is …
Apex error – ‘List has no rows for assignment to SObject’ Read More »
It’s very usual to fall in such a requirement to execute apex scheduled job every 1 hour. The dirtiest way to schedule it 24 times at a specific time. But there is another very efficient way to run it each clock hour and can be achieved by just running it once using power of cron …