Test in CodeFlow Emulator

With our code now updated we can reload our application locally, in Codeflow. To see the changes in action and test them out, go to this link localhost:3030/www/#/tab/projects?scrub=true.

The ?scrub=true query parameter tells Codeflow to clear out our localStorage tables (except the oauth ones) so that the app is rebuilt. This will ensure that the meta data on the platform relating to our new field is also pulled down.

We can see the new field in the Mobile Table Inspector in the same manner as we did using the Platform Emulator.

Screenshot of our new Expense Type field in the MTI

And our New Expense screen in the application now looks like this (note in the screenshot there are values added ready for submission);

Screenshot of our new Expense Type field in the New Expense screen

If we click click Submit our new record will be processed by our updated JavaScript controller and will be inserted into the encrypted SmartStore. Our JavaScript service logic also calls the MobileCaddy API to sync the MC_Time_Expense table following a successful insert into the SmartStore, and so a call to SFDC is made also.

We can see that this has taken place by viewing our new expense record on the device. The screenshot below shows the ID field, which in this case contains an autonumber value that was allocated by the platform. If we did not have connectivity when submitting the new record, this new expense would have still been written to the SmartStore but our record would have a temporary unique ID assigned to it.

Screenshot of our new expense record with an ID from the Salesforce platform