Retrieving Customizable User Defined Field (CUDF) List Values with SBO

Retrieving Customizable User Defined Field (CUDF) List Values with SBO

The UFD List data is stored in the USER_DEF_FIELDS table. It looks like this:


 

You can retrieve it with a direct SQL query, but you need to know the UDF’s ID for the field in question. Here is an example:

Notes
SELECT PROGRAM_ID, ID, DOCUMENT_ID, LINE_NO, DEL_LINE_NO, DATA_TYPE, STRING_VAL
FROM USER_DEF_FIELDS
WHERE PROGRAM_ID = 'STATIC_DATA'
AND ID = 'UDF-0000094'
AND DOCUMENT_ID IS NULL
AND LINE_NO IS NOT NULL
AND DEL_LINE_NO IS NULL
AND DATA_TYPE = '10050'
ORDER BY LINE_NO ASC

 

The bigger picture is:

 

Rows 1-4 – the list values (DATA_TYPE = 10050)
Row 5 – the list name (DATA_TYPE = 1005)
Rows 6 and higher are Document instances of the List UDF.

In SBO you would do this where “conn” is the SBO DatabaseConnection object:

 


The “using” statements clean up the “IDbCommand” and “IDataReader” objects to avoid resource leaks:

Notes
                List<string> list = new List<string>();
                using (IDbCommand cmd = conn.CreateNewCommand)
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "SELECT STRING_VAL " +
                                        "FROM USER_DEF_FIELDS " + 
                                        "WHERE PROGRAM_ID = 'STATIC_DATA' " + 
                                        "AND ID = 'UDF-0000094' " +
                                        "AND DOCUMENT_ID IS NULL " +
                                        "AND LINE_NO IS NOT NULL " +
                                        "AND DEL_LINE_NO IS NULL " +
                                        "AND DATA_TYPE = '10050' " +
                                        "ORDER BY LINE_NO ASC";
                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            list.Add(reader.GetValue(0).GetType().Name == "DBNull" ? null : reader.GetString(0));
                        }
                    }
                }


         



      • Related Articles

      • WM-Synergy SBO - Release Notes

        v1100.1003 - 06/11/2025 Fix Issue in ShipperLine Customer Order for Part id 500pcs, WorkOrder to make part id is for 1000pcs. Linked CO to WO for Supply links for the 500 pcs. Ship the 500 pcs from sbo objects, expectations are (Visual ERP) customer ...
      • SmartViews Scheduler User Guide

        PREREQUISITES Supported Visual version are 7.0 – 10.x Database Platform: SQL Server & Oracle Microsoft .Net Framework 4.8 ADMINISTRATION INSTALLING Use the following link to download the setup file. Once downloaded follow these steps to install. Run ...
      • WM-Synergy Business Objects SDK Information

        WM-Synergy Business Objects WM-Synergy Business Objects, SBO, is a comprehensive transaction library built on the both the .net standard and .net framework platforms. This library allows the developer to quickly read/write/update transactional data ...
      • RAM Connector - User Guide

        Prerequisites Supported Visual version are 7.0.0 – 10 Database Platform: SQL Server & Oracle .Net Framework 4.6.2 Installation Use the following Link to download the setup file. Once downloaded follow these steps to install Install Run ...
      • Synergy uniPoint Connector - User Guide

        Installation You can find the installation document for Synergy uniPoint Connector here. How to Use Overview Synergy uniPoint Connector can be used in the following Visual windows: Customer Maintenance Customer Order Entry Part Maintenance Vendor ...