ConfigurationEntryBuilder
This guide covers the `ConfigurationEntryBuilder`, which is your primary tool for creating the JSON payload needed to update `ConfigurationEntry` records with the `ManufacturingService`.
Importing the Builder
To get started, import the `ConfigurationEntryBuilder` from the `easy_acumatica.models` module.
from easy_acumatica.models.configuration_entry_builder import ConfigurationEntryBuilder
Builder Methods
Use the shortcut methods to set the key identifiers for the configuration record. The `configuration_id` is required to identify which configuration to update.
# Identify the configuration and related production order
config_payload = (
ConfigurationEntryBuilder()
.configuration_id("MYCONFIG001")
.prod_order_type("RG")
.prod_order_nbr("PO000123")
)
add_feature(feature_line_nbr, config_results_id, options)
This method adds a complete feature object, including its options, to the payload. The `options` parameter is a list of dictionaries, where each dictionary represents an option and its selection status. You must construct this list manually, ensuring the structure matches the API's requirements exactly.
# 1. Manually define the list of options for a feature
color_options_list = [
{"LineNbr": {"value": 1}, "Option": {"value": "RED"}, "Selected": {"value": False}},
{"LineNbr": {"value": 2}, "Option": {"value": "BLUE"}, "Selected": {"value": True}},
]
# 2. Use the list with the add_feature method
config_payload = (
ConfigurationEntryBuilder()
.configuration_id("MYCONFIG001")
.add_feature(
feature_line_nbr=1,
config_results_id="<some_results_id>",
options=color_options_list
)
)
to_body()
Once you have set all the required fields, call the `.to_body()` method to generate the final dictionary, which is ready to be sent as the JSON body in your API request.
# Build the full configuration payload
config_payload = (
ConfigurationEntryBuilder()
.configuration_id("MYCONFIG001")
# ... other methods
)
# Get the final dictionary
json_body = config_payload.to_body()
# Use with the ManufacturingService
# client.manufacturing.update_configuration_entry("25.100.001", builder=config_payload)