using this Methode we can create a form for a field and store a value in the sales order using configuration in the checkout.
To add new fields to Checkout, you must create custom transaction body fields in your NetSuite account. For more information on how to create custom fields in NetSuite, seeĀ Creating Custom Transaction Body Fields.
The SC Custom Fields extension only supports transaction body fields. To implement custom item, custom transaction line, and custom transaction item option fields, see Create Custom Fields by Customizing Templates.
The SC Custom Fields extension allows the following transaction body field types:
- Check Box
- Date
- Text Area
- Long Text
- Free-Form Text
When you create a transaction body field for the SC Custom Fields extension, be aware of the following:
- The Field Type must match the field type you want to include in the checkout application.
- The Web Store and Sale fields must be checked in the Applies To subtab.
- If you select the Mandatory box in the Validation & Defaulting subtab, the field is mandatory for all domains and you must mark it as required in the SuiteCommerce Configuration record for all the domains of your website.If you want the new transaction body field to be required in only one domain, you should mark the field as required in the configuration of that domain only. You do not need to mark it as mandatory during creation.
- The subtab where you want to display the custom field on the Sales Order record should be selected in the Display subtab. Otherwise, the field is shown in the Custom subtab of the Sales Order record.
Note
The character limitation for the custom fields in Commerce websites is set by the field type in NetSuite. For more information on the limits, see Field Type Descriptions for Custom Fields.
When you have created your custom transaction body fields, you are ready to Configure Custom Fields for Checkout.
Configure Custom Fields for Checkout
Use the SC Configuration record to choose which fields to add to Checkout and how they display. You can also set feedback messages that display to users on your site.
Consider the following points when determining the order and positioning of your custom fields:
- You can add a custom field before or after a standard checkout module. For example, if your SC site uses the standard checkout flow, you can add custom fields before or after the shipping method block in the Shipping Address page.
- If you want to change the order of existing modules in the checkout application, you should do this before adding new custom fields. For more information, see Reorder Checkout Modules.
- The order in which you list custom checkout fields in the Custom Fields subtab of the SC Configuration record determines the order of the custom fields in Checkout.