Authors:
Cameron Johns, Cille Schliebitz, Anita Gu
Changed on:
3 Feb 2025
This lesson walks through the implementation of a custom form field component for a Stock Reservation user action. We'll build a field that captures
`locationRef`
`quantity`
`FormFieldProps`
`StockReservation`
`FormFieldProps`
`FormFieldProps`
`onChange`
`onChange`
`FormFieldProps`
`FieldRegistry`
In this lesson, you will implement a new custom field component for a Stock Reservation user action.
The Ruleset expects an Event Attribute named "
`stockReservation`
`locationRef`
`quantity. `
`{`
` "locationRef": "F_NSYD",`
` "quantity": 1`
`}`
You will build a field to produce this value for the "
`stockReservation`
Before you begin creating your field, let's make sure the User Action button is working on the page. Since you are building upon the screen created in the UX Framework course, it is likely that this User Action is not yet configured to show in the Manifest.
Modify the fragment manifest, and enable User Actions by adding the
`actions`
`props`
`"props": {`
` "title": "Product Availability",`
` "actions": {`
` "enabled": true`
` }`
`}`
`StockReservation.tsx`
`FC`
`FormFieldProps`
`StockReservationPayload`
`onChange`
`FieldRegistry`
`'./fields/StockReservation';`
`STRING`
`stockReservation`
Once complete, open the user action form, and you should see the "Hello Form" text, indicating that the UX Framework has successfully mapped your custom field component to the attribute type defined in the workflow.
This video explains how to create a custom field
Copyright © 2025 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.