cancel
Showing results for 
Search instead for 
Did you mean: 

Invoke PM Engine from SFM Custom Action

Pastry Chef
Pastry Chef

Invoke PM Engine from SFM Custom Action

I would like to know how to configure Custom Action to Invoke PM engine from PM plan wizards. Any one has any idea on which class & method needs to be used and required parameters?

We would like to enable this feature so that as soon as PM plan is active, users can generate PM WOs without waiting PM engine job to run.

Any inputs greatly appreciated.

Message 1 of 8
7 Replies
Sushi Chef
Sushi Chef

Re: Invoke PM Engine from SFM Custom Action

As far as I am aware, there is no such option. We did get some code to run during testing to fire the PM engine but stopped doing that since we had issues. I know our org is far from default though.
The solution we use today is have a PM Process scheduled to run every evening for PM Plans that meet the criteria but also have "emergency" in their name. That way the PM Work Orders and Case are created without waiting for the normal PM Process schedule. Would that be an option for you? In addition these users are subscribed to a report that flags these PM Plans that have emergency in the name, so they don't forget to remove that from the name the next day :-)

Message 2 of 8
Pastry Chef
Pastry Chef

Re: Invoke PM Engine from SFM Custom Action

Hi Rob,

Thank you for quick reply. We do run daily job for all PM plan. We would like to give more control to users to generate PM work order. If you could share us the script that you used and know issues then I will explore further and share my findings.

Message 3 of 8
Sushi Chef
Sushi Chef

Re: Invoke PM Engine from SFM Custom Action

Hi Sandeep,

I'm a business user (admin) and this "script" was provided by ServiceMax to our IT. This is some 4 years ago and as far as I know we don't have it anymore, but Michael Majerus​ or someone else in ServiceMax support may be able to provide it. Maybe the easiest way is just to log a ticket with support...

Message 4 of 8
0 Likes
Reply
Pastry Chef
Pastry Chef

Re: Invoke PM Engine from SFM Custom Action

Not sure if this still works as it was from 2013, but feel free to try and share your experiences!

Open developer console and run the following code to run the PM process and generate the work orders

String StrSVMXProcessID = 'Test_PM_Process'; // ServiceMax Process ID

String StrSFPMProcessID = [Select Id From SVMXC__ServiceMax_Processes__c where SVMXC__ProcessID__c =: StrSVMXProcessID AND SVMXC__Active__c = true].Id;

SVMXC.PREV_Engine_Batch EngObj = new SVMXC.PREV_Engine_Batch(); EngObj.setProcessIds.add(StrSFPMProcessID);

ID Batch = database.executebatch(EngObj, 1);

Message 5 of 8
Community Manager
Community Manager

Re: Invoke PM Engine from SFM Custom Action

Michael Majerus doesn’t work for SeeviceMax, he is a customer, just like you all! I know he’s super active, supportive and helpful in this community, in fact, he’s leading the West Coast user group next month West Coast User Groupat Maximize. I’m sure he’ll be happy to weigh in if he has experience in this.

Thanks!


____

Did you know solutions are the most powerful thing in this community?  When someone answers your question - only you can mark it as a solution.
Help other members find valuable content faster - Mark Responses As Solutions and give out Kudos (Likes)!
Message 6 of 8
Fry Chef
Fry Chef

Re: Invoke PM Engine from SFM Custom Action

Hi Sandeep Reddy Musku​,

during our implementation our SVMX Consultant created an SFM Custom Action (Action Type URL) which points to the following address:

https://c.na6.visual.force.com/apex/SVMX_PS_PM_InvokePMProcess

We then added this SFM to the PM Plan Wizards, so that the scheduling team can select the appropriate PM Plan Process to run when they need Work Orders generating asap rather than waiting for the overnight scheduled runs.

I'm not sure if the code is OOTB or had been added specifically for us though.

Message 7 of 8
Pastry Chef
Pastry Chef

Re: Invoke PM Engine from SFM Custom Action

Hi Bob,

I am looking for same configuration. This is not available out of the box can be configured. I can't access Custom Action URL you shared. Can you share screenshot or configuration details of this Custom Action? I need to know the class and method to invoke and parameters to pass. I have raised a case with SVMX support and awaiting for the same steps.

Thanks,

Sandeep

Message 8 of 8
0 Likes
Reply