Skip to content Skip to sidebar Skip to footer

How to Create a Custom Action for Mobile Salesforce File Upload

For whatsoever successful Field Service Arrangement, constructive management of numerous moving parts such equally a team of service technicians, or field force, is i of the nearly operational challenging tasks. Thankfully, Salesforce Field Service provides users with all the necessary tools to schedule work orders, acceleration service technicians, manage the unabridged mobile workforce, track labor hours and job condition, and capture payments for completed work orders.

Salesforce Field Service mobile app is the one-stop solution that brings advancement and boosted functionality in on-site job management to your mobile workforce. This brand new FSL app is custom-designed for highly-flexible and customizable work order execution. This app aims to meliorate the first-visit resolution by empowering mobile users with this all-time-in-grade mobile solution that delivers job scheduling management.

But while working with the Salesforce mobile app, some specific considerations and limitations need to be taken care of for quick actions, such every bit designing a use case or building Lightning spider web components. With Wintertime '21 release new features, Salesforce offers developers the ability to create their HTML-based mobile extensions for native Salesforce Field Service App. This feature isn't by and large bachelor and is currently in the airplane pilot phase.

In the Salesforce Field Service Platform, the end-users accept a wide range of choices to execute various deportment built natively on Salesforce through flows or standard quick deportment. Even so, we cannot create a fully customizable menses for lightning web components (LWC) or aureola components that run in the background. This is currently a limitation on Salesforce Field Service. And hither, a Mobile extension toolkit would be an ideal solution to use your custom screens with personalized user interface flows.

In this blog, nosotros will hash out how to create a mobile extension bundle, upload the package to Salesforce, access mobile extensions from global actions, and debug mobile extensions.

High-level Capabilities Include:

  • Deep Links and Mobile Extensions
    • Ability to deep link for a custom folio (activity) with passing parameters.
    • Read the parameters in the code and dispense them accordingly.
  • Balance APIs
    • APEX REST API Execution
      • Execute custom apex logic
    • External REST APIs
      • Call to external APIs from exterior of salesforce
  • Go FSL Context API
    • Login User info
      • Salesforce User id, language, locale
    • Device Info
      • Device language, locale
    • Capture Info such as the source record that you open from the action
      • Record id, object type
    • Mobile version info
      • FSL mobile version
      • Salesforce API version
  • Record APIs
    • Create Record
    • Update Tape
    • Delete Tape
  • Query APIs
    • Execute SOQL Query
    • Get Record
    • Get Related List
  • Metadata APIs
    • Get Object Info
    • Get Picklist Values
  • User Interface API
    • Dismiss (Close the custom action)
    • Barcode Scanner
  • Native Bridge APIs
    • Network Connection
      • Cheque connection status
      • Register events on mobile connection condition modify offline/online.
    • Geolocation API
    • Camera Access

Build A Mobile Extension Bundle

Step ane: A mobile extension is built as an HTML5 bundle. Firstly, you need to create a native HTML app on your car with an alphabetize.html file. This Alphabetize.html should be at the root level, and this is a must as this is the entry point of your extension.

Pace 2:Afterward your index file is ready, start forming your application structure with scripts and other related features yous would like to add together.

Pace 3: Now comes the testing of the native HTML extension. Navigate to Salesforce setup → Mobile Extension Toolkit (Airplane pilot) → Upload your HTML extension as a goose egg (ensure index.html is always nowadays on the root).

Footstep iv: After the mobile extension is successfully uploaded, you need to add it in our global or quick actions to trigger the extension.

Steps To Upload A Mobile Extension

Step one: From Setup, enter Field Service Mobile in the Quick Find Box and then select Mobile Extension Toolkit (Beta)

Step 2:Click New Extension

Step iii: Enter the required details for the mobile extension:

a. Cull HTML5.Nada file to upload.

b. Provide a unique proper name and description for the mobile extension.

c. Click Save.

Steps To Add A Mobile Extension To An Object

Pace 1: First, navigate to the object for adding the mobile extension in the object manager.

Step 2:Select Buttons, Links, and Actions

Step 3:Select the new activity

Step 4:Enter the required details for the new action.

a. For action blazon, select Field Service Mobile Extension.

b. For Field Service Mobile Extension, select the mobile extension yous would like to utilize.

c. Enter a label for the action, and the name field is filled in automatically.

Pace 5: Now, Get back to the object; you have to add a new action. Then, Select Page Layouts and select the layout for which you take to add the activeness.

Pace half-dozen: In the Salesforce Mobile and Lightning Feel Actions, add together the action you created to the quick actions and so click Salvage. The app users can access the mobile extension as a quick action from the app.

How To Debug Mobile Extensions

To develop a mobile extension, you need to build the bundle locally on your desktop using a local HTTP server to host the bundle directory.

Opposite proxying for Android Devices

The WebView that is used to host mobile extensions is completely secured to prevent external hosts from accessing it. To debug a mobile extension, y'all need to connect your Android phone via USB cable to your estimator and set a spider web server for hosting your mobile extension files.

You can too use contrary proxying to forward requests from the emulator'due south NAT-ed network to your host network using ADB reverse. This delivers port 8080 on the emulator to port 8080 on your development machine.

$ adb reverse tcp:8080 tcp:8080

Install HTTP server

$ npm install http-server -g

Go to package example directory and run server:

$ cd examples/getRecord  $ http-server .

To debug Mobile Extensions, the steps are given below:

ane. Provide debugging access to users

a. Go to Setup >> Connected Apps >> Manage Continued Apps .

b. Click Salesforce Field Service for Android or Salesforce Field Service for iOS .

c. Click New on Custom Attributes.

d. Prepare Key to DEBUG_MOBILE_EXTENSION_USERNAMES , and then you need to add a comma-separated list of usernames.

east. Log out from the application and then log in back into the Field Service mobile app for settings updates.

2.Join the Field Service Mobile Beta and Early Adopters Program -To access the Mobile Extension Webview in the app, use the beta build that is part of this program.

3.Log in to the app to launch the mobile extension.

a. Make sure your mobile extension is being served from your preferred web server.

b. Launch the Field Service mobile app and log in using specified usernames in the Connected App custom attribute.

c. Navigate to Settings | Advanced Settings | Mobile Extension Webview .

d. Enter the full URL for the spider web server that is used to host your mobile extension.

For Android devices, yous tin can connect Chrome Developer Tools to the spider web view example. Afterward that, you lot need to set Javascript breakpoints, step through lawmaking, inspect variables, and more.

Mobile Extension Instance:

Equally an instance of the versatility of mobile extensions, Asperii developed one that is able to practice all of the following:

  • Create a custom page (Activeness) on SFS mobile app
  • Use salesforce 'Lightning Design System' styles
  • Scan a barcode
  • Query for an existing nugget by scanning a barcode
  • Update a service date with this asset
  • Take a photo of the asset
  • Get the current mobile geolocation and store it on the service date description field and in Latitude & longitude fields)
  • Create and upload a photo/file to an zipper tape, related to the current Service Appointment.

The following is a sample of Asperii'southward mobile extension code:

All-time Practices For Using Mobile App Extensions In Salesforce Field Service

  1. It is advisable to use the Mobile extension WebView for debugging.
  2. Scripts, CSS, and other related components need to be placed in dedicated folders of the native HTML5 app.
  3. It is recommended that developers perform an offline JS test code before uploading the goose egg in Salesforce as the Mobile extension does non provide whatever native JS code testing.
  4. You need to exam the code in Android and IOS devices for both iPad and iPhone every bit native HTML elements perform differently in various devices.
  5. Mobile extensions are available in full-screen view and work on the Field Service mobile app.
  6. When you tap on an HTML link to a page within the packet, the folio is correctly launched. But if y'all tap on a link to a folio outside of the bundle, yous will receive the warning that the domain is untrusted.
  7. If a mobile extension is deleted but the quick activity referencing it remains in the page layout, and the extension was opened on the user's device, the user tin can continue to use the extension until they log out of the app.
  8. When you update or delete a mobile extension, the changes will not be updated until they log out of the app or clear the cache.
  9. You cannot use mobile extensions on desktop computers.
  10. Your resources path in the bundle should not begin with a forward slash '/' east.g., <script type=" text/javascript" src=" / app.js">.
  11. In the Field Service app, deep links can encode up to 1MB of data, due to which users won't be able to encode large amounts of information within deep link URIs.

Limitations Of Salesforce Field Service Mobile App Extension

  1. Unavailability of native debugging and testing tools. Debugging pick is only available with the Mobile extension WebView. Also, desktop testing is not supported.
  2. Calling native noon methods is not supported in Field Service Mobile Extension. Apex methods can be chosen if they are exposed as residue service via apex rest resources.
  3. Native lightning data service & lightning elements are not supported.  But, predefined FSL methods are supported in Salesforce Field Service.
  4. Brake of third-party reference links. It is required to download 3rd party scripts and then add them to the current nix artifacts for successful working.

Final Wrap

Salesforce Field Service Mobile App is an all-in-one, feature-rich tool that empowers technicians to take a 360-caste view of work orders and service appointments. It provides field service users with a broad array of features such as verifying customer data and using Chatter to communicate with other team members.  For a modern, customizable mobile workforce, this enterprise-class mobile experience leverages Salesforce in lightweight design optimization.

Offline capability in Salesforce Field Service Mobile App empowers users to keep working without internet connectivity and receive all the updates for changes. Salesforce FSL Mobile App Extensions is an out-of-the-box characteristic that enables technicians to communicate inflow with the customer.

With Salesforce Field Service mobile app extensions, you can leverage innovative capabilities like dial-out to other applications, perform events, and switch back into the application context. The app users tin simply launch the mobile extension every bit a quick activity using mobile extensions in the Salesforce Field Service mobile application.

garciathendous.blogspot.com

Source: https://www.asperii.com/blog/salesforce-field-service-mobile-extension-toolkit-overview/

Postar um comentário for "How to Create a Custom Action for Mobile Salesforce File Upload"