Tips and Takeaways From Getting the Apex Specialist Superbadge

I’ve started the new certification path for the Platform Developer II as I already passed the multiple choice question a long time ago but it was ridiculously hard getting a slot on the programming assignment. With this new format, I would need to complete these four superbadges.

So, 1 out 4 completed. I got the Apex Specialist Superbadge nailed.

For the Apex Specialist superbadge. There are a total of 6 mini challenges you need to complete. Requirements are straightforward. If you been developing on the platform for some time, the challenge should be a breeze. It took me 6 hours though to coymplete the challenge.

Takeaways from the challenge

  1. There are many options for building the solution. Just stick with where you are most familiar with.
  2. Use maps for more efficient querying and to bulkify your triggers
  3. I thought I already know all my JSON stuffs until I tried to manually parse a JSON string. Get familiar with using the JSON class methods. Check my post on Demystifiyng JSON parsing in Apex.
  4. Given another chance since the requirements are not that complicated this would’ve been a good practice to have tried test-driven development.

If you need help completing the challenge hit the comments below and I’ll be glad to help. Good luck on getting that superbadge.

Demystifying JSON Parsing In Apex

You got back a JSON string either as a response from a REST service, passed through from your visual force page via remote action or passed from your lighting component to your apex controller, now how do you parse this information? For simple JSON structures Salesforce can automatically parse them for you. There are tools online that would generate apex classes from the JSON string that would assist in parsing the JSON input.

It is good to get back to the basics and understand a little bit how the JSON string is structured and how the parsing is done.

What is JSON? JSON is the acronym of Javascript Object Notation and is a lightweight format that is used for data exchange between servers and modern applicationsIt is based on a subset of JavaScript language (the way objects are built in JavaScript).

Read the rest of this entry »

Using the Batch Resource Salesforce REST API

While coming up with a solution design for  an API integration piece for work I found the REST API batch resource feature relevant to my use case. The feature has been around since Summer 2015 and I didn’t know much about it then. Basically the batch resource allows you to make multiple request in a single API call.

I needed to come up with a simple solution for creating a single record and has option to pass an array of records to be created. I initially had been looking at 3 options and listed the things to consider on the development side.

  • REST API via the sobject resource
    • use sobject resource for record creation
    • no Apex code
    • cannot do array
  • Apex Rest API
    • accepts an array of the records
    • use of JSON parser and deserializing the request body
    • create test classes
  • Bulk API
    • last option
    • overkill for the job and too many things to consider to get the integration setup

Read the rest of this entry »

How to Access phpMyAdmin on Google Cloud Compute on your Mac

I’ve been doing a small bit of Google Cloud Compute(GCP) configurations to run this blog. I thought I’ll start sharing some of the steps I’ve gone through which could be useful to others out there. So I’ve setup a GCP instance and configured it with a WordPress Bitnami stack. I’ve got some videos of those in this playlist if you want to follow along.

But on this post I would be discussing about accessing phpMyAdmin on GCP via an SSH Tunnel on your Mac.

In order to access phpMyadmin on a WordPress Bitnami stack from Google Cloud Compute you need to do this using an SSH tunnel. On the WordPress Bitnami stack, phpMyAdmin is blocked from the public and only accessible from the localhost. This is where SSH tunnel comes in. Basically you access the localhost on a particular port on your computer that forwards that information to the remote server on an encrypted channel and then the remote server sends the content back to the local computer.

Here is an illustration on how that access is provided via the SSH tunnel.

Another example of using SSH tunnel is when a website is blocked from your company firewall or proxy filter, you can use SSH tunnel to bypass the proxy and connect to a remote computer that has no restriction and can access the blocked website.

With that said, lets connect via SSH tunnel on your Mac.

  1. Open the terminal and change directory to where your private key is located
  2. Type in following, replace the private key name, user and IP to match yours. Enter passphrase when prompted.
    • ssh -N -L 8888: -i <keyfile> <username>@<ip>
  3. If successful it would not prompt any errors. If you want to login to the instance you can strip out the -N parameter.
    • ssh  -L 8888: -i <keyfile> <username>@<ip>
  4. Open your brower and enter
  5. You should be able to view phpMyAdmin


Here is a video I made for the process.


That should be it. If you have questions or comments please use the section below and feel free to subscribe to my youtube channel.

Hidden Gems on the Spring 18 Salesforce Release For Developers

Salesforce Spring 18 comes with some pretty nifty updates for developers. Been playing around with some of the new stuffs and will come up with some videos for each as I get in depth with them more.


  • Flow Enhancements
    • Ability to add Lightning Components to Flow –  lightning:availableForFlowScreens
    • We can already make Lightning Component as a Quick Action, now you can do that with Flow too
  • New Base Lightning Components
    • This  new base components works together and allows you to build forms faster. It determines the field type, field level security and displays the field styled(LDS) accordingly. Similar to using force:inputInputField but with less controller and apex work.
      • lightning:recordEditForm
      • lightning:inputField
    • New base components – carousel, formattedAddress, formattedName, formattedTime, inputAddress, inputField, listView, pillContainer, treeGrid, and prechatAPI.
  • Salesforce DX
    • Two types of second generation packing
      • ISV type managed packaging
      • Developer controlled packaging – unmanaged packaging but upgradeable. Wuhoo!
  • Component Library
    • View documentation on the base and your custom built lightning components
      • simply add /componentReference/ to the base URL
  • Einstein Vision
    • This soo cool, you can train deep-learning models to detect images and count distinct objects within an image with Einstein Object Detection.
  • UI API
    • Recreate the Salesforce page layout on any web app or mobile app. You can can pretty much do CRUD operations with the API.
  • Some other stuffs worth mentioning
    • Cloning sandbox now in beta
    • Debugging – public site users no longer need a browser cookie to activate debug logging. FTW.
    • Custom metadata in validation rules in pilot

What are your favourite features?

Stay tuned!