April 2017 archive

Only Aggregate Expressions Use Field Aliasing – SOQL Error

Only Aggregate Expressions Use Field Aliasing – SOQL Error Out of many other errors we encounter, this is one with the SOQL. Many times, when writing SOQL, we face the error – “Only Aggregate Expressions Use Field Aliasing” and we are stuck that what’s happening, everything seems all right to me. You must be missing …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/only-aggregate-expressions-use-field-aliasing-soql-error/

TestSetUp method in apex test classes

TestSetUp method in apex test classes @testsetup annotation in test class method Test classes are an important part of overall SDLC in Salesforce. We as a developer have to write the test classes very often, and we need to create the test data as well, to have our test class executed successfully. We’ll cover a new …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/testsetup-method-in-apex-test-classes/

Compare old and new field values in trigger

Compare old and new field values in trigger Salesforce Sometimes we have requirement that our trigger should run only when some field value is changed on a record. So we need to compare value of that field between old version of record and new version of record to make sure that trigger will not run every …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/compare-old-and-new-field-values-in-trigger/

Use static resource in Visualforce

Static resource archive structure

Use static resource in Visualforce – Salesforce Force.com platform provides us a facility to upload, manage and use the content that is static (not changing) for your organization, and it can be stored under “Static Resources“. It can be a Javascript file, CSS file, an image or even a zip file containing all the files …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/use-static-resource-in-visualforce/

apex:pageMessage and apex:pageMessages – Salesforce

pageMessages

apex:pageMessage and apex:pageMessages – Salesforce Most of the times we are confused between these two visualforce components i.e. apex:pageMessage and apex:pageMessages. A small different of ‘s’. Let’s see the difference between apex:pageMessage and apex:pageMessages – Salesforce. We are confused that which one should we use, and in which case. There is a small difference between these two. …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/apexpagemessage-and-apexpagemessages-salesforce/

Relationship Query in Apex – Salesforce

How to create relationship name

Relationship Query in Apex – Salesforce Relationship Query in Apex – Salesforce soql relationship query Most of the times, we have relationships between the objects(master-detail OR lookup) and often we need to fetch the list of all child records related to parent record in SOQL. This can be achieved using relationship query in Salesforce. We …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/relationship-query-apex-salesforce/

Transient Keyword – View State – Visualforce – Salesforce

View State In Salesforce

Transient Keyword – View State – Visualforce – Salesforce View State in salesforce What is view state in salesforce? ViewState holds state of the visualforce page that holds state that includes the fields, components and controller state. Viewstate data in encrypted and cannot be viewed tools like firebug. There is a limit of 135KB of …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/transient-keyword-view-state-visualforce/

Test class in salesforce with example

Test class in Salesforce with example Test class in salesforce Testing is an important part of SDLC. So, before deploying our code to production environment, Salesforce requires at least 75% of your code to be covered by our test classes whic. Salesforce has done that to make sure that our code doesn’t break in any situation …

Continue reading

Permanent link to this article: https://www.sfdcpoint.com/salesforce/test-class-with-example-salesforce/