Convert epoch to datetime in Apex

We get this requirement while coding several time to convert epoch time (Unix time) to Datetime. First thing, never store a epoch time in Integer and use Long always. Below given code can be used to convert into datetime: To get the epoch from a datetime variable you can just call the getTime() instance method:

Apex error – ‘List has no rows for assignment to SObject’

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 »

Efficient Way to Access Custom Metadata Type in Apex

getAll() to get Custom Metadata Type Records Now let see how we can get Custom Metadata Type records with getAll() method. getInstance() to get Custom Metadata Type Record What about if you don’t need to get all record and need to access only single record? In that case you can use the getInstance() method.

Guest site user causing TEMPLATE_NOT_FOUND error

You may get this error that email is not being sent when guest user is creating record (ex. Case creation, self registration etc.) – Error can be as “Submission Error: The record couldn’t be saved because it triggered an email alert that failed. Please contact salesforce.com Customer Support.” like https://salesforce.stackexchange.com/questions/343779/guest-user-cannot-send-vf-email-template-while-having-access-to-objects-fields Actually, it’s security measure taken …

Guest site user causing TEMPLATE_NOT_FOUND error Read More »

What is Hyperforce in Salesforce

1. Hyperforce is a major infrastructure-level change. Instead of managing first party data centers, Salesforce will leverage major public clouds (AWS to begin with) to offer different salesforce services.2. Customers don’t have to worry about existing customizations or integrations in their orgs. In short, If it works today, it will work when their orgs are …

What is Hyperforce in Salesforce Read More »

Freemium Einstein Features Included with Your Salesforce Edition For Service Cloud

Service Cloud Einstein Einstein Bots Unlimited 25 Einstein Bots conversations per user/per month Einstein Case Classification Enterprise, Performance, and Unlimited Editions Build one predictive model to recommend field values, in real-time, to your agents at no additional charge Einstein Article Recommendations Enterprise, Performance, and Unlimited Editions Unlimited for agent users Einstein Next Best Action Essentials, …

Freemium Einstein Features Included with Your Salesforce Edition For Service Cloud Read More »