Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|---|---|---|---|---|---|
Hard coding in Apex Salesforce means directly embedding specific values or variables into the code instead of referencing them from a configurable source such as Custom Settings, Custom Metadata, or Custom Labels.
It is generally advisable to avoid hard coding in Apex Salesforce for the following reasons:
Maintainability: Hard-coded values are often difficult to maintain and update as they require code changes every time the value needs to be modified. This makes it harder to manage and scale the application over time.
Flexibility: Hard-coded values make the application less flexible, as changes cannot be made without editing the code. By using configurable sources such as Custom Settings, Custom Metadata, or Custom Labels, values can be easily modified without requiring code changes.
Reusability: Hard-coded values are not reusable and cannot be shared across multiple classes or triggers. By using configurable sources, values can be easily accessed and shared across the entire application.
Testing: Hard-coded values make it more difficult to test the application since the values are fixed and cannot be changed during testing. By using configurable sources, values can be easily changed during testing to ensure that the application is working as expected.
Here are some examples of how hard coding in Apex Salesforce can be problematic and how using configurable sources can be a better solution:
Hard coding a specific email address in Apex code to send email notifications. Instead, you can create a Custom Setting or Custom Metadata type to store the email address and reference it in the code.
Hard coding a record type ID in Apex code to create a new record of a certain type. Instead, you can create a Custom Setting or Custom Metadata type to store the record type ID and reference it in the code.
Hard coding a specific currency exchange rate in Apex code to perform currency conversions. Instead, you can create a Custom Setting or Custom Metadata type to store the exchange rate and reference it in the code.
Hard coding a specific picklist value in Apex code to update a field on a record. Instead, you can create a Custom Label or Custom Metadata type to store the picklist value and reference it in the code.
By using configurable sources such as Custom Settings, Custom Metadata, or Custom Labels, values can be easily modified without requiring code changes. This makes the code more maintainable, flexible, and reusable.
In summary, avoiding hard coding in Apex Salesforce can make the application more maintainable, flexible, reusable, and easier to test. It is generally best practice to use configurable sources such as Custom Settings, Custom Metadata, or Custom Labels instead of hard-coded values.
1 | Derya Baskol | 1080 |
2 | Tugbag Tamer Yilgin | 855 |
3 | Solmaz Aliyeva | 585 |
4 | Efe Kadioglu | 285 |
5 | Sercan Kara | 190 |
6 | Emel Sarli | 190 |
7 | Ahmet Derdiyok | 140 |
8 | Fatma Ablak Oren | 135 |
9 | Zeynep Yildiz | 110 |
10 | Ridvan Ay | 85 |
11 | hatice nal | 60 |
12 | Bahar Erdagi | 55 |
13 | Mehmet Akin | 55 |
14 | Osman Demirel | 46 |
15 | Aysun Bilgic | 45 |
16 | EA | 45 |
17 | Nora Arslan | 20 |
18 | Okan Ozcelik | 10 |
19 | Zeynep SEMİZ | 10 |
20 | Engin Basturk | 10 |
1 | Derya Baskol | 10181 |
2 | Solmaz Aliyeva | 5950 |
3 | Okan Ozcelik | 5597 |
4 | Tugbag Tamer Yilgin | 5478 |
5 | Ayse Yilmaz | 2248 |
6 | Fatma Ablak Oren | 1470 |
7 | Emel Sarli | 1406 |
8 | Sercan Kara | 1405 |
9 | Ahmet Derdiyok | 980 |
10 | Mehmet Akin | 800 |
11 | Zeynep SEMİZ | 770 |
12 | Osman Demirel | 736 |
13 | Kemal Ozdemir | 695 |
14 | Zeynep Yildiz | 665 |
15 | Aysun Bilgic | 609 |
16 | Bahar Erdagi | 603 |
17 | Safiyye Arslan | 510 |
18 | Efe Kadioglu | 450 |
19 | Nora Arslan | 450 |
20 | Engin Basturk | 437 |
1 | Derya Baskol | 1080 |
2 | Tugbag Tamer Yilgin | 855 |
3 | Solmaz Aliyeva | 585 |
4 | Efe Kadioglu | 285 |
5 | Sercan Kara | 190 |
6 | Emel Sarli | 190 |
7 | Ahmet Derdiyok | 140 |
8 | Fatma Ablak Oren | 135 |
9 | Zeynep Yildiz | 110 |
10 | Ridvan Ay | 85 |
11 | hatice nal | 60 |
12 | Bahar Erdagi | 55 |
13 | Mehmet Akin | 55 |
14 | Osman Demirel | 46 |
15 | Aysun Bilgic | 45 |
16 | EA | 45 |
17 | Nora Arslan | 20 |
18 | Okan Ozcelik | 10 |
19 | Zeynep SEMİZ | 10 |
20 | Engin Basturk | 10 |
1 | Derya Baskol | 49955 |
2 | Engin Basturk | 26793 |
3 | Fatih | 24248 |
4 | Solmaz Aliyeva | 23081 |
5 | Zehra Bulut | 21583 |
6 | Okan Ozcelik | 19655 |
7 | ZY | 18016 |
8 | Zeynep Yildiz | 17170 |
9 | Alaattin Kokcu | 16962 |
10 | Burcu Derdiyok | 16611 |
11 | Cavidan | 16514 |
12 | Bahar Erdagi | 15779 |
13 | Sebahattin Dalgic | 15756 |
14 | Ozlem Helva | 15623 |
15 | Esra Balci | 15343 |
16 | Ada Lozzy | 14765 |
17 | Emel Sarli | 14290 |
18 | Tugbag Tamer Yilgin | 13909 |
19 | Hakan Can | 13232 |
20 | Mehmet Y | 13024 |