Creating MAS Package
You can create a Mobile Activity Space (MAS) package to deploy it on any environment based on requirements.
Creating the MAS package includes the following steps:
1. Developing Activity Space
2. Testing and debugging activity space
3. Modifying activity space
4. Packaging activity space
1. Developing Activity Space
1. Initialize Activity Space.
2. To create Activity Space from the provided template, run the following command from the shell terminal: npm run create <New Activity Space Name> This creates the activity space folder with the given name under the activity-space folder, with sample HTML, JS, and CSS.
Development Notes
Follow these key development notes:
• Do not rename the file "index.html".
• In the file "index.html", there is js scripts imported file (activity-space-infra.js). Do not remove this file. <script type="text/javascript" src="../activity-space-infra.js" ></script>
• The custom-activity-space.js file has activitySpaceInit() function. This function is called from Activity Space Infra on the initialization of the Activity Space. This method is your starting point for any custom business logic required to be executed during startup. const activitySpaceInit = function() {....}
• You can organize the activity space code (CSS, JS) as per your development practices.
• You can design the HTML content in (index.html) as you want.
• You can use any Web Development IDE for development such as Visual Code or WebStrom.
2. Testing and Debugging Activity Space
To test the activity space:
• Run the following command: npm run start
• Open a web browser and navigate to the following URL: http://localhost:3000
• In "Custom Activity Space - Launch Form", perform the required data selection from the dropdown list.
• Click the Launch Activity Space button. A new tab is opened with your selected activity space displayed. Now you can perform browser-based debugging.
3. Making Changes to Activity Space
You can make the change and refresh the activity space browser tab.
4. Packaging Activity Space
When your activity space is ready, you can zip the activity space by running the following command:
npm run zip
This creates a separate zip file for each activity space. You can now upload the zip file on the Custom Action page. For more information, see
Configure MAS Custom Action.
System Provided Data
By default, the activity space code has access to the following data:
• record: You can access the source record, on which the activity space is invoked through window.record, the record will have all the available properties as per the SalesForce field-level access permissions.
• userInfo: Details about the logged-in user, and the list of available properties are available in sample user info given in the default.json.
• deviceInfo: Details of the user device, and the list of available properties are available in the sample device info given in the default.json.
APIs
The following APIs are available: