It is normal for Mobile Applications to be developed in a sandbox instance and then either migrated to Integration, QA or UAT sandboxes or of course to a Production instance.
The guide below runs through how to prepare your Mobile Application for export. This process is the same for either the first export you do or for a subsequent Version (Dynamic Version) exports.
At the high level this process will create a Salesforce Document (which will be an exportable version of the configuration of the Mobile Application) which along with a number of VisualForce Pages and Static Resources and any Salesforce Objects and Fields your app requires will form the Salesforce Changeset ready for uploading and then receiving in the destination environment.
In this article:
- Create the Mobile Application Export Document
- Create a Changeset made up of the following
- Mobile Application Export Document
- Mobile Application Export Digest Document (.dig)
- Mobile App Start Page Version (VisualForce Page)
- Mobile App Cache Page Version (VisualForce Page)
- Mobile App Recovery Page (VisualForce Page)
- Mobile App Bundle Version (Static Resource)
- Any Objects / Fields / Record Types etc that are required by your application
- Any Classes / Triggers / Tests required by your application
Versions: For up to package 1.0.80 – needs to be updated for beyond this to handle the digest doc
Step 1 – Create the Mobile Application Export Document
- Make sure the MobileCaddy application is selected from the Salesforce App Menu.
- Navigate to the Startup Tab.
- In the ‘Mobile Applications’ page section press the button Export Full App or Single DV.
- You will then be presented with a page and drop down ‘Structure Document Name’.
For this you will always want the latest version of the ‘MC_SeedApp001_ObjectRef_XXX’ – this will be preselected for you.
- Hit Select.
- On the next page, you will be shown a list of Mobile Applications that are available in this Salesforce Instance. Select the Mobile Application you wish to export (or the Mobile Application that you wish to export a Dynamic Version from) and then press the Select button.
- You will now be presented with a new page section ‘Select One Dynamic Version’
Here you should select the Dynamic Version that you wish to export. Note you may only see one Dynamic Version or several depending on how many have been created for your Mobile Application.Once you have selected press the button Export Selected DV.
- You’ll then be shown a summary of the Mobile Application you have selected and the Dynamic Version you have selected. If these are correct press Continue.
- The process to create the ‘Mobile Application Export Document’ will now start. This process is a chained series of Apex Queueable jobs. The initial Job ID will be shown and you can navigate to Setup > Jobs > Apex Jobs to view the status of the Apex Job.If you are interested in viewing the Jobs you can read more below. If not, skip to the next step to check your ‘Mobile Application Export Document’ has been created successfully.
For information, there will be four chained jobs – all four need to complete successfully to produce the ‘Mobile Application Export Document’. The Jobs will fire in the order below (the references below are to the Apex Classes called by each Job).
- To confirm if your ‘Mobile Application Export Document’ has been created successfully, navigate to the Salesforce tab ‘Documents’. Then Select the Folder ‘MobileCaddy – Data Population’.
- If you sort the list of Documents by descending ‘Last Modified’ your Documents should be at the top of the list (this will be both the Mobile Application Export Document and its related ‘Digest’ document.As an example of the names of the ‘Mobile Application Export’ Document and the related Digest document they will look like this
For your Documents the TES will be the first three letters of your Mobile Application name (this is the field ‘Application Name’ on the ‘Mobile Application’ record)
A Document export version will be assigned as shown as 001 in the above example. This does not represent the Dynamic Version – purely an incremental version number of the export
Make a note of these Document names as these will be required to add to you Changeset (or deployment) in the next step.
Step 2 – Prepare and Upload your Changeset / Deployment File
Now that you have the ‘Mobile Application Export Document’ created we can move on to migrating this alongside the other components.
- Navigate to the Salesforce Setup.
- Select Outbound Change Sets.
- Select New to create a new Outbound Change Set.
- You will then need to give your Outbound Change Set a name and a description.
- Now you are ready to add the ‘Change Set Components‘ as below – for ease we have shown the Category to select to locate each component.
Change Set Category Component(s) Documents
Mobile Application Export Document
Mobile Application Export Document Digest
Mobile App Start Page Version (VisualForce Page)
Mobile App Cache Page Version (VisualForce Page)
Mobile App Recovery Page (VisualForce Page)
Mobile App Bundle Version (Static Resource) Dependent on specific app requirements
Any Objects / Fields / Record Types etc that are required by your application Dependent on specific app requirements
Any Classes / Triggers / Tests required by your application Apex Class
Platform Class Restriction Classes & Test Classes (Apex Classes used where any of your Mobile Tables have been specified to use ‘Platform Restriction Class’) Static Resource
Cordova Resource (Static Resource)
MockCordova Resource (Static Resource)
MobileCaddy Resource (Static Resource)
- Once you have all the components added to the Change Set you are ready to ‘Upload’ your Change Set to any destination orgs configured to receive inbound change sets. Once this changeset has been deployed you can then begin the import process in the destination org (which is either a new Mobile Application or a specific Dynamic Version). Please see our relevant documents on these processes for further instructions.