Configuring PM Plan Web Service
The Preventive Maintenance (PM) Plan module includes a web service for generating PM Plan Details such as PM Schedule Definitions, PM Schedules, and Applicable Product Coverages on a PM Plan during creation. This web service includes the function OOTB as part of the PM Plan Creation SFM Transactions.
The PM Plan Details web service can be invoked outside of an SFM Transaction, as part of a batch process or custom code. This allows you to automate PM Plan creation, or for mass creation of PM Plans as part of a custom process.
PM Plan Automation Components
The following table lists the methods and parameters required for invoking the PM Plan Details Web service outside of an SFM Transaction.
Class Name : Global PREV_PMAutomation
Method Name
Input Parameters
Output Parameters
CreatePMPlanFromAccount
PREV_PMAutomationRequest
PREV_PMAutomationResponse
CreatePMPlanFromLOC
PREV_PMAutomationRequest
PREV_PMAutomationResponse
CreatePMPlanFromSC
PREV_PMAutomationRequest
PREV_PMAutomationResponse
CreatePMPlanFromIB
PREV_PMAutomationRequest
PREV_PMAutomationResponse
The following code provides the sample request/response structure and parameters:
global sharing class PREV_PMAutomationRequest
{
webservice list<Strings> pmPlanIdList{get;set;}
}
global class PREV_PMAutomationResponse
{
webservice Boolean success{get;set;}
webservice String message{get;set;}
webservice String messageType{get;set;}
webservice list<PREV_PMAutomationResult> results{get;set;}
}
Global Class PREV_PMAutomationResult
{
webservice String pmPlanId {get;set;}
webservice String errorMessage {get;set;}
webservice Boolean success{get;set;}
}
Code Snippet
For invoking the PM Plan web service, use the following sample code snippet:
SVMXC.PREV_PMAutomation.PREV_PMAutomationRequest request = new SVMXC.PREV_PMAutomation.PREV_PMAutomationRequest();
request.pmPlanIdList = new List<String>{'PM Plan SF Id'};
SVMXC.PREV_PMAutomation.createPMPlanFromAccount(request);
//SVMXC.PREV_PMAutomation.createPMPlanFromLOC(request);
//SVMXC.PREV_PMAutomation.createPMPlanFromSC(request);
//SVMXC.PREV_PMAutomation.createPMPlanFromIB(request);
* 
Note: If your organization is offering PM Plans for Installed Based, then ensure that the IP records are created before generating PM Plans with them as coverages.
Was this helpful?