Previous Next JavaScript must be enabled to correctly display this content

## 9.22 Steps for adding Pre/post methods in extended components

This topic provides the systematic instructions to perform the basic operations on the selected records.

Suppose here we consider that we want to persist custom fields on postnext call (which means first ‘self.next’ method of base would get called and then the control will come in postnext method written in extended component).

1. Write postnext method in .js file of the extended component – where in user can call the custom Api for persisting the custom fields.
2. Expose this method in the .json file of the extended component.
3. Similarly we can add prenext method as well.(it would get executed before ‘self.next’ method of base executes).

   Note:

   The hooks for these methods to work should be a part of common infrastructure components in appshell.
4. Below is the list of CCAs and the common methods which has pre and post hooks:

   Table 9-1 List of CCAs - Field Description

   CCA Name | Common method name | Pre hook present | Post hook present
   --- | --- | --- | ---
   fsgbu-ob-cmn-ct-authorization | compare | No | Yes
   approve | No | Yes
   fsgbu-ob-cmn-ct-act-summary- template | delete | No | Yes
   reopen | No | Yes
   close | No | Yes
   fsgbu-ob-cmn-ct-maintenance | save | Yes | Yes
   fsgbu-ob-cmn-ct-wizard | next | Yes | Yes
   previous | Yes | Yes
   saveClose | Yes | Yes
   cancel | Yes | Yes
   hold | Yes | Yes
   Applicable for custom footer buttons as well | Yes | Yes
   fsgbu-ob-cmn-ct-rs-authorization | approve | No | Yes
   fsgbu-ob-cmn-ct-summary-template | delete | No | Yes
   open | No | Yes
   close | No | Yes

Parent topic: Extensibility Use Cases for OBX