Web Service Syntax
All SFM web services must adhere to a standard syntax so that they can be integrated with SFM screen events.
When the Apex class is configured in a process, if it is updating the SFM delivery page, then fields to be updated must be present in page layout/field sets.
As required by Apex, the web service class must be declared as global so that it can be accessed from the SFM screen.
The web service method must accept an input parameter of type SVMXC.INTF_WrapperDef.INTF_TargetRecord.
The web service must be declared with the return data type SVMXC.INTF_WrapperDef.INTF_PageData.
After processing the incoming record(s), the processed record(s) must be converted to the return data type using a special utility method provided by ServiceMax as shown below.
With the above considerations, the structure of an SFM Apex web service would be like this:
global class AnyClass
{
webservice static SVMXC.INTF_WrapperDef.INTF_PageData AnyMethod (SVMXC.INTF_WrapperDef.INTF_TargetRecord AnyTarget)
{
...
...
// Your logic goes here...
...
...
SVMXC.INTF_buildPageData PageUtil = new SVMXC.INTF_buildPageData();
return PageUtil.INTF_buildPageData(AnyTarget);
// Apex Exception Handling Block
}
}
You must also build Apex unit test classes for each SFM web service
The input and return data types are highly generic and hierarchical in nature to ensure scalability. Hence, using and updating the incoming data is a complex process. Refer to the Update Header and Update Details web service examples sections for implementation templates of custom web services.
Was this helpful?