SFM Transaction for Editing a Dependency Management Group
Perform the following steps to create the SFM transaction to edit a dependency management group:
1. Create an SFM transaction of the type As standalone for the purpose of editing an existing record.The configuration for this SFM transaction is the same as the configuration for the SFM Transaction for Creating a New Dependency Management Group. For information about creating SFM transactions, see How to Create an SFM Transaction.
2. Perform the following configuration steps:
a. Hide the Edit button in the Dependency Management object page layout.
b. Configure Edit SFM in the SFM wizard of the Dependency Management object.
3. Create a Visualforce page with the following information:
[Apex]<apex:page standardController="SVMXC__Dependency_Management__c" extensions="EditDependency" tabStyle="SVMXC__Dependency_Management__c" showheader="true" action="{!EditDependency }" />
4. Edit the COMM_Controller Apex Class and add the following method:
[Apex]public with sharing class EditDependency{ public EditDependency (ApexPages.StandardController controller) { } public PageReference EditDependency ()
{ try { return RedirectTo('Dependency_Management__c','Edit_Work_Order_Dependency'); }catch(Exception ex) { throw ex; } }
public PageReference RedirectTo(String strObjName, String strSFMProc) { map<String, Schema.SObjectType> objGlobalDescribe = new map<String,
Schema.SObjectType>(); String strObjectName = strObjName; String strKeyPrefix = ''; objGlobalDescribe = Schema.getGlobalDescribe();
Schema.DescribeSObjectResult objSobjectDescribe = objGlobalDescribe.get('SVMXC__' + strObjectName).getDescribe();
strKeyPrefix = objSobjectDescribe.getKeyPrefix(); PageReference objRedirect = new PageReference
('/apex/'+'SVMXC__ServiceMaxConsole'+'?SVMX_processId=' + strSFMProc + '&SVMX_retURL=../' + strKeyPrefix); objRedirect.setRedirect(true); return objRedirect; }}
5. Override the Edit button on the Dependency Management page layout with the above SFM:
a. Navigate to View Object > Dependency Management. Go to the Buttons, Links, and Actions section.
b. Edit the New link, click the Visualforce page check box, and select the VF page you have created.
c. Remove the Edit button from the Salesforce page layout for Dependency Management and Configure the Edit Dependency Group SFM in a custom SFM wizard for the Dependency Management object by performing the following steps:
i. Navigate to View Object > Dependency Management and click New.
ii. Specify the following information for the fields:
Field
Value
Label
Edit SFM
Display Type
Detail Page Button
Behavior
Display In the existing window with a sidebar
Content Source
URL
Code
/apex/SVMXC__ServiceMaxConsole?SVMX_recordId=
{!SVMXC__Dependency_Management__c.Id}&SVMX_action=SFM&SVMX_processId
=Edit_Work_Order_Dependency&SVMX_retURL=/{!SVMXC__Dependency_Management__c.Id}
d. Navigate to Dependency Management, select a group, edit the layout, and insert the Edit SFM button.
Was this helpful?