Coding techniques that keep your
admins happy
Writing configurable code in Salesforce
Roy Gilad, Israel Salesforce DUG, Le...
Roy Gilad
Israel Salesforce DUG Leader
CRM Solution Manager, Conduit Mobile
@RoyGilad
Coding techniques that keep your admins happy

What is this session
about?
DRY principle
Don’t Repeat Yourself:
“Every piece of knowledge must have a single, unambiguous,
authoritative representati...
Coding techniques that keep your admins happy
In this presentation we will cover:

Custom Labels

Field Sets

Custom Setti...
Custom Labels
Custom Labels
What is it?
 Custom labels are custom text values that can be accessed from
anywhere:
 Apex classes

 Vis...
Custom Labels
Why should we use it?
 Text to be maintained by a system administrators.
 DRY: Reuse and consistency throu...
Custom Labels
Where can we find them?
 Setup-> Build -> Create -> Custom Labels
Custom Labels
Demo
Custom Labels
Where should we use it?
 Text in pages
 Error messages in triggers
 When you have multi-lingual org – A M...
Custom Labels
How to use them?
 Apex:

 System.Label.Label_name
 Visualforce:
 {!$Label. Label_name}

 Formula and va...
Field Sets
Field Sets
What is it?
 Set of fields in an object that can be used dynamically in
Apex and in Visualforce pages.

 Fiel...
Field Sets
Why should we use it?
 Pages and integrations can be controlled by a system administrators.
 DRY: Reuse and c...
Field Sets
Where can we find them?
 Can be defined for any object:
• In standard objects it can be found under the object...
Field Sets
Demo
Field Sets
Where should we use them?
 Visualforce pages and controllers.
 Fields that are sometimes presented and update...
Field Sets
How to use them?
 Visualforce pages:
• {!$ObjectType.Account.FieldSets.FieldSetName}

 Apex:
• SObjectType.Ac...
Custom Settings
Custom Settings
What is it?
 Similar to custom objects.
 Enable developers to create custom sets of data.
 Enable to cr...
Custom Settings
Why should we use it?
 Access dictionary tables without querying.
 Can provide Profile-specific and User...
Custom Settings
Where can we find them?
 Setup -> Build -> Develop -> Custom Settings
Custom Settings
Demo
Custom Settings
Demo
Custom Settings
Demo
Custom Settings
How do I use them?
 Apex
 List Custom Setting:

 Hierarchy:
 CustomSettingsName__c.getInstance(UserId ...
Summary
In this presentation we covered:

Custom Labels

Field Sets

Custom Settings
Roy Gilad
Israel DUG Leader,
@RoyGilad
Code is available for download at:
https://gist.github.com/RoyGilad
Presentation is available at:
http://www.slideshare.ne...
Coding Techniques That Keep Your Admins Happy
Upcoming SlideShare
Loading in …5
×

Coding Techniques That Keep Your Admins Happy

643 views

Published on

Do you want to spend more time developing new and exciting features, and less time maintaining existing code when a field is added or an error message needs to change? Then keep yourself and your Administrator happy by coding to anticipate these changes using Custom Settings, Field Sets, and Labels. Join us as we show examples of these techniques and how they allow you to code so that your features can be easily configured.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
643
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
57
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Coding Techniques That Keep Your Admins Happy

  1. 1. Coding techniques that keep your admins happy Writing configurable code in Salesforce Roy Gilad, Israel Salesforce DUG, Leader Conduit Mobile, CRM Solutions Manager @RoyGilad
  2. 2. Roy Gilad Israel Salesforce DUG Leader CRM Solution Manager, Conduit Mobile @RoyGilad
  3. 3. Coding techniques that keep your admins happy What is this session about?
  4. 4. DRY principle Don’t Repeat Yourself: “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”
  5. 5. Coding techniques that keep your admins happy In this presentation we will cover: Custom Labels Field Sets Custom Settings
  6. 6. Custom Labels
  7. 7. Custom Labels What is it?  Custom labels are custom text values that can be accessed from anywhere:  Apex classes  Visualforce pages  Formulas  Validation rules
  8. 8. Custom Labels Why should we use it?  Text to be maintained by a system administrators.  DRY: Reuse and consistency throughout the organization.  Code readability.  Multi-lingual support.
  9. 9. Custom Labels Where can we find them?  Setup-> Build -> Create -> Custom Labels
  10. 10. Custom Labels Demo
  11. 11. Custom Labels Where should we use it?  Text in pages  Error messages in triggers  When you have multi-lingual org – A MUST!  Place-holder for repeated string in your code.
  12. 12. Custom Labels How to use them?  Apex:  System.Label.Label_name  Visualforce:  {!$Label. Label_name}  Formula and validations:  $Label. Label_name
  13. 13. Field Sets
  14. 14. Field Sets What is it?  Set of fields in an object that can be used dynamically in Apex and in Visualforce pages.  Field sets are a powerful tool when you have a number of fields used in the same operation, or in the same context.
  15. 15. Field Sets Why should we use it?  Pages and integrations can be controlled by a system administrators.  DRY: Reuse and consistency throughout the organization.  Code readability.
  16. 16. Field Sets Where can we find them?  Can be defined for any object: • In standard objects it can be found under the object name: • In custom objects it can be found as a related list in the object:
  17. 17. Field Sets Demo
  18. 18. Field Sets Where should we use them?  Visualforce pages and controllers.  Fields that are sometimes presented and updated together.
  19. 19. Field Sets How to use them?  Visualforce pages: • {!$ObjectType.Account.FieldSets.FieldSetName}  Apex: • SObjectType.Account.FieldSets. FieldSetName.getFields()
  20. 20. Custom Settings
  21. 21. Custom Settings What is it?  Similar to custom objects.  Enable developers to create custom sets of data.  Enable to create and associate custom data for an organization, profile, or specific user.
  22. 22. Custom Settings Why should we use it?  Access dictionary tables without querying.  Can provide Profile-specific and User-specific tables.
  23. 23. Custom Settings Where can we find them?  Setup -> Build -> Develop -> Custom Settings
  24. 24. Custom Settings Demo
  25. 25. Custom Settings Demo
  26. 26. Custom Settings Demo
  27. 27. Custom Settings How do I use them?  Apex  List Custom Setting:  Hierarchy:  CustomSettingsName__c.getInstance(UserId ProfileId);
  28. 28. Summary In this presentation we covered: Custom Labels Field Sets Custom Settings
  29. 29. Roy Gilad Israel DUG Leader, @RoyGilad
  30. 30. Code is available for download at: https://gist.github.com/RoyGilad Presentation is available at: http://www.slideshare.net/RoyGilad/salesforce-codingtechniques-that-keep-your-admins-happy-df13

×