- Use header comments on top classes as below:
/**
@
name :
@
author :
@
date :
@
description :
@
VF page Name :
*/
- Variable/method names needs to be in camelCase as possible. Like creatCase(), getClosedWonOpportunity() etc.
- Variables names must be meaningful as possible, don't like x, y etc
- Use curly braces with same line instead of next line in if/else and loops constructs as below:
}
- Comments at on every possible complex logic, on top of each methods also about its working.
- Keep method as possible small , if going logic more than 50 rows, then break that into other method.
- Test classes must be meaningful, means must have asserts of the main logic, must have coverage near to 80% as possible (at-least 75% is required), use separate test class to cover each separate apex class.
- Use proper Oops concept as possible , means use private where ever possible, extends, method overriding , method overloading etc.
- Don’t hard code ids and any hard code values in code, use query to fetch data or in test classes make new objects.
- Don’t hard code message or error text, try to use Label as possible (If client says).
- Use components as possible for header, footer in pages.
- use standard apex tags as possible.
- Whenever possible make your Utility class which has useful, re-used methods and put your methods in that and use that class in every class logic.
- If any trigger logic is very big, then try to make one class and put your logic in that class and call that class in your trigger. Keep trigger small and as simple as possible.
- Check if condition before using the list. eg:
if(ContactList.size() > 0)
{bla bla}
- Avoid Nested loops, which may cause maximum script statements governor limits to be hit. Should make use of Maps to avoid nested loops.
NOTE: The aforementioned Best Practices are according to
me. Salesforce itself output their own Best Practices. I have cited and
summarized some of the excerpts it.
The applications on Force.com platform using Apex, I am sure you may have been in need of debugging your code. Salesforce being cloud platform, method to debug code is very different as compared to other programming languages. In this post we will discuss all about Apex code debugging, challenges, solutions and other best practices.
ReplyDeletesalesforce training in chennai
I am obliged to you for sharing this piece of information here and updating us with your resourceful guidance. Hope this might benefit many learners. Keep sharing this gainful articles and continue updating us.
ReplyDeleteSalesforce Training in Chennai
German Classes in Chennai
Salesforce certification Training in Chennai
Salesforce.com training in chennai
best german classes in chennai
German language training in chennai
smm panel
ReplyDeleteSMM PANEL
iş ilanları
instagram takipçi satın al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
Tiktok jeton hilesi indir
Congratulations on your article, it was very helpful and successful. 57eeaddb602baac8c865425e7ed85a32
ReplyDeletewebsite kurma
numara onay
sms onay
Thank you for your explanation, very good content. aae4fd5f054b5b6a1222d9ae457fcfe2
ReplyDeletealtın dedektörü
Good content. You write beautiful things.
ReplyDeletesportsbet
vbet
mrbahis
hacklink
taksi
vbet
sportsbet
korsan taksi
hacklink
Good text Write good content success. Thank you
ReplyDeletemobil ödeme bahis
slot siteleri
betmatik
betpark
kralbet
bonus veren siteler
poker siteleri
kibris bahis siteleri
çorum
ReplyDeleteantep
ısparta
hatay
mersin
R0OWJ
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
TV8N
شركة مكافحة حشرات بالاحساء QfvXfESCNm
ReplyDeleteشركة مكافحة النمل الابيض بالخبر pudXDP92dS
ReplyDelete