Posted in Salesforce

Salesforce: Display Related Files of Parent in Child Record

To display files of Parent Record in Child Record as a Related List, you can make use of <apex:relatedList>

Continue reading “Salesforce: Display Related Files of Parent in Child Record”

Posted in Salesforce

Salesforce Apex : Writing Unit Test for ContentDocument

Salesforce’s SObject – ContentDocument supports only SELECT and DELETE operation. However INSERTing the document may be needed for writing Unit Tests which is not supported. There needs to be a workaround for it.

Continue reading “Salesforce Apex : Writing Unit Test for ContentDocument”

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:


Return Value

Lightning Platform



Lightning Platform Communities

ChatterNetwork Communities


CRM (Lightning Page)


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