Launching a Web Service
Android and iOS
Administrators use the SFM Custom Action of type Web Service to invoke custom code from the header record and the child record directly on Salesforce. You can edit the header and child records or create child records using the custom code.
The custom action is configured to run Aggressive Sync after executing the custom code. Changes made to the records are updated on the mobile app and the technician is not required to trigger Data sync manually. Ensure that the Run Sync flag on the SFM Wizard step is enabled for the Aggressive Sync to work after the Web Service execution.
* 
- This custom action requires internet connectivity.
- SOAP-based custom Web Services are supported.
To invoke the Web Service
1. Build the custom code. For sample Apex, web service code, refer to Building Custom Apex Web Service for SFM.
2. Configure an SFM Custom Action of type Web Service on the server. For more information on how to configure Custom Action of type Web Service, see Custom Action of type Web Service.
3. Configure an SFM Wizard for the SFM Custom Action of type Web Service on the server. Ensure that the Perform Sync After WS Call checkbox on the SFM Wizard step is enabled for the Aggressive sync to work after the Web Service execution.
4. Invoke the Web Service from Go App.
* 
An error message is displayed with the exact error details when the web service invoked from a custom action fails. You can take necessary actions to resolve the errors and launch the web service again.
Windows
Administrators use the SFM Custom Action of type Web Service to invoke custom code on Salesforce directly. You can edit the header and child records or create child records using the custom code. The header record and its child records are the ones from which the custom action is invoked.
The custom action is configured to run Aggressive Sync after executing the custom code. Changes made to the records are updated on the mobile app, and the technician is not required to trigger Data sync manually. Ensure that the Run Sync flag on the SFM Wizard step is enabled for the Aggressive Sync to work after the Web Service execution.
* 
- This custom action requires internet connectivity. - SOAP-based custom Web Services are supported.
To invoke the Web Service
1. Build the custom code. For sample Apex, Web Service code, see Building Custom Apex Web Service for SFM.
2. Configure an SFM Custom Action of type Web Service on the server. For more information on how to configure Custom Action of type Web Service, see Custom Action of type Web Service.
3. Configure an SFM Wizard for the SFM Custom Action of type Web Service on the server.
* 
Enable the Perform Sync After WS Call checkbox on the SFM Wizard step for the Aggressive sync to work after the Web Service execution.
4. Invoke the Web Service from the Windows App. By default, the following screen is displayed when the web service is being executed.
* 
If any specific message is configured by your administrator, the message is displayed instead of the default screen.
* 
An error message is displayed with the exact error details when the web service invoked from a custom action fails. You can take necessary actions to resolve the errors and launch the web service again.
Was this helpful?