Git Product home page Git Product logo

exchangerates's Introduction

ExchangeRates

Platform Cache Currency Sample

This repository contains all the code, settings, and cache partition for the Platform Cache Currency sample. The app displays a sample set of currency exchange rates. After initially getting the rates from a web service, the app stores and retrieves rates from the org cache.

Initial Setup Instructions

  1. Download this repository as a zip file.
    • The zip file contains all the files that are needed to install and access the app in Salesforce.
  2. Deploy the zip file to your org using Metadata API through Workbench, Force.com IDE, or the Force.com Migration Tool. Your org's user must have the API Enabled permission.
  3. Assign the included Currency App Setting permission set to your user.

Use the Currency App

  1. In the App Launcher, select Currency App.
    • The app has two tabs. The Exchange Rates Sample tab displays the Visualforce page that lists the exchange rates. The Exchange Rates tab lists the Exchange_Rate__c custom objects that the app populates.
  2. Click the Exchange Rates Sample tab.
    • When the ExchangeRates Visualforce page displays, its Apex controller, also called ExchangeRates, is invoked. The controller executes the logic of initializing and caching exchange rates. The rates are initially obtained from an external web service and are stored in the org cache. Because the cache is temporary, custom object records are used to persist exchange rates in Salesforce. The app refreshes rates that are more than a day old from the external service. After initial execution, subsequent retrievals of exchange rates are obtained from the cache. The app handles cache misses by fetching the rates from Saleforce through SOQL when they're not found in the cache.

Check the Cache Partition

To check the cache partition that this sample uses:

  1. In Setup, enter Platform Cache in the Quick Find box, then select Platform Cache.
  2. Click CurrencyCache. The cache partition that this sample uses contains no space allocation for session and org cache (0 MB). The 0 MB allocations is so that you can use this partition for testing purposes, even if your org doesn't have trial cache approved yet. Cache operations are allowed in this partition but no values are stored or returned. Therefore, such a partition enables the testing of cache misses when null is returned for cache get() calls.

Platform Cache Documentation and Trailhead Module

exchangerates's People

Contributors

dcarroll avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.