Posted in Salesforce

Salesforce Apex : Evaluate Boolean String Expression

(FALSE AND ((TRUE OR FALSE) AND (TRUE OR FALSE)))

Wondering how to evaluate this expression which is a string using Apex?

Following class can be used to evaluate:

Continue reading “Salesforce Apex : Evaluate Boolean String Expression”

Advertisements
Posted in Code Snippets, Salesforce

Salesforce: Making a Trigger to execute at last

I had an After trigger in a Grand-child object that does some calculations with Child object and updates the result in Parent object. All the calculation logic were perfectly alright. But the result was wrong!

Continue reading “Salesforce: Making a Trigger to execute at last”

Posted in Salesforce

Lightning Component : Is it in Community or in Lightning Page?

To check if the Lightning component is in Lightning Community Page or in Salesforce Lightning CRM page, we can make use of Site Class‘s method – getSiteType().

This returns String value as:

Site

Return Value

Lightning Platform

Visualforce

Site.com

Siteforce

Lightning Platform Communities

ChatterNetwork

Site.com Communities

ChatterNetworkPicasso

CRM (Lightning Page)

null

Continue reading “Lightning Component : Is it in Community or in Lightning Page?”