How to schedule a class to run once at a specific time from apex

Salesforce gives out of the box ability to schedule apex classes with some limited options to control frequency under setup => apex classes => "Schedule Apex" button. But this approach limits you to run apex classes only at the start of the hour.

If you have a need to run a scheduled apex class at a specific time, you can use custom CRON expressions gives a more flexible way to do that.


Note that nextRun can be any datetime value in this case. Here we generate a cron expression from the datetime provided. If you want to read more about cron expressions refer this blog.

How to scan barcode values and send to Salesforce

Here we are covering how we can scan barcode values and execute some actions in Salesforce using the scanned data. This is achieved using a mobile app "Barcode To Cloud". It is available for iOS and Android as FREE to get started.

This app allows you to scan different barcode formats (QR Code, Code 128, Code 39, Data Matrix, Codebar, PDF417, EAN13, ISBN etc) and send data to Salesforce. You can configure the app to do differnt activities in Salesforce when a barcode or QR code is scanned.

Below actions can be configured in the app using the data obtained from scanning.

  • Create a record in Salesforce with data from barcode
  • Find a record in Salesforce matching barcode data and display in the app
  • Find a record with barcode data and update it
  • Find a record with barcode data and delete it
  • For complex operations including records from multiple objects, create a record in Salesforce using barcode data and use a trigger/process builder to execute additional operations


Short Demo Video

Full Demo Video

This video shows a detailed walkthrough of the app covering below items.

  1. Connecting to Salesforce - watch
  2. Receive shipments at warehouse with notes - watch
  3. Receive shipment and scan continuously - watch
  4. Importing configuration - watch
  5. Retrieve account details when account number barcode is scanned and allow users to update details - watch
  6. Track attendance at an event using barcode in ticket - watch
  7. Simple demo - Post scanned barcode to chatter as the scanning user - watch


Demo Video (Old Version)

This video shows a detailed walkthrough of the app covering below items.

1) Connecting to Salesforce

2) Updating Checked In At field on lead record when lead's email is scanned using the app

3) Displaying lead record details by scanning email QR code

If you are looking for a free appexchange app to generate barcode, please check out Barcode and QR Code Generator.


Use cases

Barcode generation and scanning can be used to improve a lot of business processes. Some examples are,

  • Generate product barcodes and stick it as labels to products so that you can scan using mobile app and add products to opportunity
  • Generate QR code corresponding to your event registration custom object field(Id or registration number). Send QR code in email confirmation to the users. Later when users arrive at the event you can scan reservations using the mobile app
  • Stick a QR code in your outgoing shipments and incoming shipments. Then scan it and send to Salesforce records using the mobile app so that you can track shipments at different stages of shipping

Export/Import Configuration

This configuration driven app allows you to export the configurations you created and share with your team members. Your team members can later import these configurations and the app will be ready to use without any additional configuration


Need fully branded mobile app for your business?

This is a generic mobile app designed to support use cases of all types of users. So features in the app are generic. If you need a fully custom branded mobile app that interacts with your Salesforce environment and designed spcifically for your business requirements, please contact me at albertsfo1@gmail.com