The ITroubleTicketManagementPOST interface enables customization of POST operations using Apex lifecycle hooks. Implementations can validate and enrich creation payloads, apply additional business logic, and modify the final response structure, ensuring that customer-creation workflows remain flexible maintaining TMF-compliant behavior.
These hooks are not used for the Trouble Ticket Management API. If implemented, the method may be invoked, but its return values are ignored.
configureDefaultValidations
customiseGraphQLQuery
Note
Creation Lifecycle Use Cases and Hook Mapping
The following table lists common use cases for POST operation.
Use Case
Hook(s)
Description
Example Scenarios
Benefit
Enforce Business Rules
applyCustomValidations
Validates customer creation requests before processing to ensure they comply with business rules, data quality constraints, and organizational policies. Prevents invalid or duplicate customer records from entering the system.
• Block creation of customers with duplicate names or identifiers• Reject requests with invalid customer types or lifecycle statuses• Enforce mandatory business validations (e.g., email/phone standards)
Prevents invalid or low-quality customer records from being created, improving data integrity
Auto-Populate Fields
customiseMutationPayload
Automatically enriches or computes field values during customer creation. Ensures consistent and accurate population of derived or dependent fields before data is persisted.
• Generate customer display name from first/last name• Auto-calculate classification, segment, or service level• Populate geo-encoding or internal routing codes
Reduces manual data entry, enforces consistency, and improves data accuracy
Audit Trail
handlePostOperation
Adds audit metadata to newly created customer records after persistence, ensuring every creation event is traceable for security and compliance.
• Stamp “createdBy”, “createdAt” values• Add system identifiers for correlation or traceability• Trigger downstream audit logging services
Maintains a reliable and compliant audit trail across all customer creation events
transformRequest
This hook transforms the request context before processing any operation. It is invoked early in the request lifecycle, allowing implementers to adjust the context for subsequent extensibility hooks.
This hook modifies the GraphQL query before execution to add fields, filters, or transformations. Returns a map with a nodes key containing a list of QueryTransformationNode objects.
When to use the hook: Use it when you need to fetch or customize related data before record creation, especially for complex business logic.
When not to use the hook: Avoid it for standard POST operations, simple payload changes (use customiseMutationPayload), or validations (use applyCustomValidations).
Note
customiseMutationPayload
This hook modifies the mutation payload before creating a customer record. Use this to add computed fields, set defaults, or transform the payload based on business logic.
1mutation CreateCustomerAndRelatedEntities {2 uiapi {3 customerAccount: AccountCreate(input: {4 Account: {5 Name: "Acme Corp",6 Industry: "Technology",7 Status: "Active"8 }9 }) {10 Record {11 Id12 Name { value }13 }14 }15 }16}
Using modifyInput with addInputFields adds new fields to the input payload. These fields are added to the Account object within the input wrapper and are sent to the mutation.
Note
Create Enhancements: Modify Existing Input Fields
Original Mutation (GraphQL):
1mutation CreateCustomerAndRelatedEntities {2 uiapi {3 customerAccount: AccountCreate(input: {4 Account: { Name: "Acme Corp" }5 }) {6 Record {7 Id8 Name { value }9 }10 }11 }12}
1mutation CreateCustomerAndRelatedEntities {2 uiapi {3 customerAccount: AccountCreate(input: {4 Account: { Name: "Updated Company Name" }5 }) {6 Record {7 Id8 Name { value }9 }10 }11 }12}
The inputModifications replaces the values of existing input fields. The transformer identifies the wrapper key, for example Account and applies the changes at the correct nested level.