I’ve added a custom user-defined field (UDF) to track secondary bin locations in our warehouse management system, but the data isn’t persisting after save. The field appears in the UI and users can enter values, but when we reload the record, it’s blank.
The UDF configuration looks correct in the system:
SELECT FieldName, TableName, DataType FROM UDFConfig
WHERE FieldName = 'SecondaryBinLocation';
-- Returns: SecondaryBinLocation | InventoryItem | VARCHAR(50)
The field shows up in forms and users can type in bin codes like “A-12-03”, but after clicking Save and reopening the item, the field is empty. Other standard fields save fine. Is there something special about UDF field mapping for warehouse bin locations that I’m missing?
I’ve dealt with this exact issue. The problem is that warehouse bin table structure has special handling in Epicor SCM. Bin location fields go through additional validation logic that checks against the BinMaster table. If your UDF isn’t configured to participate in this validation, the system might be clearing it as invalid. You need to either map your UDF to an existing bin validation framework or mark it as a non-validated text field. Check the field properties in UDFConfig - there should be a ValidationRule column.
That’s a classic symptom of a missing UDF mapping in the business object layer. The data saves to the database initially, but then the business object’s refresh method overwrites it with null because it doesn’t know about your custom field. You need to register the UDF in the InventoryItem business object’s field mapping configuration. Check your customization layer to ensure the UDF is included in the save/load field list.
Another angle - are you saving through the API or directly in the UI? If you’re using custom code to save, you might not be including the UDF in your save method call. The standard UI forms might also need to be customized to include UDF fields in their data binding. I’ve seen cases where the field appears in the UI but isn’t actually bound to the save operation.
You’re hitting three separate issues that all need to be fixed for UDFs to work properly with warehouse bin data:
UDF Field Mapping:
The business object needs explicit field mapping. Add your UDF to the InventoryItem business object configuration:
<field name="SecondaryBinLocation"
column="SecondaryBinLocation"
type="string"
persist="true"/>
Warehouse Bin Table Structure:
Bin location fields in Epicor have special relationships with the BinMaster and WarehouseLocation tables. Your UDF needs to either:
- Reference valid bin IDs from BinMaster (use a foreign key), OR
- Be marked as free-text with no validation
If you want validation, modify your UDF configuration:
UPDATE UDFConfig
SET ValidationRule = 'BinMaster',
ReferenceTable = 'BinMaster',
ReferenceColumn = 'BinCode'
WHERE FieldName = 'SecondaryBinLocation';
Save/Update Logic:
The critical piece is ensuring your UDF participates in the save operation. In your customization layer, explicitly include the UDF in the field list:
InventoryItem item = InventoryHelper.getItem(itemId);
item.setUDFValue("SecondaryBinLocation", binLocation);
item.save(); // Must include UDF in save field list
The reason your data disappears is that the business object refresh happens after the database save, and it’s overwriting your UDF value with null because the field isn’t registered in the object’s field map. The warehouse bin table structure adds another layer because Epicor validates bin references by default.
To fix completely: 1) Add the field mapping to the business object configuration, 2) Set up proper bin validation or disable it for free-text, 3) Ensure your save logic includes the UDF in the persistence field list. After making these changes, restart your application server to reload the business object definitions.
First thing to check - did you add the UDF column to the actual database table? The UDFConfig table just registers the field definition, but you need to physically alter the InventoryItem table to add the column. Run this to verify: SELECT SecondaryBinLocation FROM InventoryItem LIMIT 1. If you get a column not found error, that’s your problem.
Checked the table structure and the column exists. I can even see the data briefly in the database right after save, but it disappears after a few seconds. Could there be some validation or cleanup process that’s removing the values?