Coding Techniques That Keep Your Admins Happy

  • 322 views
Uploaded 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 …

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.

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
322
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
48
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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. Roy Gilad Israel Salesforce DUG Leader CRM Solution Manager, Conduit Mobile @RoyGilad
  • 3. Coding techniques that keep your admins happy What is this session about?
  • 4. DRY principle Don’t Repeat Yourself: “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”
  • 5. Coding techniques that keep your admins happy In this presentation we will cover: Custom Labels Field Sets Custom Settings
  • 6. Custom Labels
  • 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. 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. Custom Labels Where can we find them?  Setup-> Build -> Create -> Custom Labels
  • 10. Custom Labels Demo
  • 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. Custom Labels How to use them?  Apex:  System.Label.Label_name  Visualforce:  {!$Label. Label_name}  Formula and validations:  $Label. Label_name
  • 13. Field Sets
  • 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. 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. 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. Field Sets Demo
  • 18. Field Sets Where should we use them?  Visualforce pages and controllers.  Fields that are sometimes presented and updated together.
  • 19. Field Sets How to use them?  Visualforce pages: • {!$ObjectType.Account.FieldSets.FieldSetName}  Apex: • SObjectType.Account.FieldSets. FieldSetName.getFields()
  • 20. Custom Settings
  • 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. Custom Settings Why should we use it?  Access dictionary tables without querying.  Can provide Profile-specific and User-specific tables.
  • 23. Custom Settings Where can we find them?  Setup -> Build -> Develop -> Custom Settings
  • 24. Custom Settings Demo
  • 25. Custom Settings Demo
  • 26. Custom Settings Demo
  • 27. Custom Settings How do I use them?  Apex  List Custom Setting:  Hierarchy:  CustomSettingsName__c.getInstance(UserId ProfileId);
  • 28. Summary In this presentation we covered: Custom Labels Field Sets Custom Settings
  • 29. Roy Gilad Israel DUG Leader, @RoyGilad
  • 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