CustomFieldDataAccess Class Reference

Overview

The CustomFieldDataAccess class provides a centralized interface for retrieving and updating Custom Form Field (CFF) values in SYSPRO from within CyberStore. It supports both legacy (SYSPRO < 7.0) and modern (SYSPRO 7+) versions, offering compatibility through conditional logic that selects the correct e.Net business object (COMSFM or COMTFM).

For a full list of SYSPRO functional area codes (e.g., “ORD” for Sales Orders, “STK” for Stock Codes), refer to the SYSPRO Functional Area Codes documentation.

This document outlines each method in the class, including parameters, return types, and usage notes.

In this Topic


DetermineSysproCustomFormFieldDataType

Signature:

public static string DetermineSysproCustomFormFieldDataType(string value)

Parameters:

  • value: The string input to evaluate.

Returns: string - one of "ALPHA", "NUMERIC", or "DATE".

Description: Detects the appropriate CFF data type for a given string value.


GetCustomFieldValue

Signatures:

public static string GetCustomFieldValue(string FunctionalArea, string key, string FieldName)
public static string GetCustomFieldValue(string FunctionalArea, string key, string FieldName, bool UseCache)

Parameters:

  • FunctionalArea: The SYSPRO functional area code (e.g., "ORD", "STK").
  • key: The primary key for the SYSPRO record.
  • FieldName: The name of the custom form field to retrieve.
  • UseCache: (optional) Whether to use the cache. Defaults to true.

Returns: string - value of the custom field.

Description: Fetches the value of a specific CFF for a single item within a functional area.


GetCustomFieldValues

Signature:

public static Dictionary<string, string> GetCustomFieldValues(string FunctionalArea, string key, bool UseCache, XPComConfig ComConfig = null, params string[] FieldNames)

Parameters:

  • FunctionalArea: The SYSPRO functional area code.
  • key: The primary key for the record.
  • UseCache: Whether to use cache.
  • ComConfig: (optional) The SYSPRO communication config.
  • FieldNames: (params) One or more field names to retrieve.

Returns: Dictionary<string, string> - map of field names to their values.

Description: Retrieves multiple CFFs from a record in a specified SYSPRO functional area.


SetCustomField

Signature:

public static XmlDocument SetCustomField(string FormType, string KeyField, string FieldName, string Value, string ValueType, bool isAdd = false, Dictionary<string, string> KeyFields7 = null, string ColumnName = "")

Parameters:

  • FormType: The SYSPRO functional area code (e.g., "ORD").
  • KeyField: The record key name (used in SYSPRO < 7.0).
  • FieldName: The name of the custom field (used in SYSPRO < 7.0).
  • Value: The data to store.
  • ValueType: The data type ("ALPHA", "NUMERIC", or "DATE").
  • isAdd: (optional) Boolean for insert (true) vs update (false). Default: false.
  • KeyFields7: (optional) Dictionary of key field/value pairs for SYSPRO 7+.
  • ColumnName: (optional) Display column name of the field for SYSPRO 7+.

Returns: XmlDocument - result of the SYSPRO e.Net call.

Description: Sets a single custom form field on a SYSPRO record.


SetCustomFields

Signature:

public static XmlDocument SetCustomFields(string FormType, Dictionary<string, string> KeyFields, Dictionary<string, string> dataFields, bool isAdd = false)

Parameters:

  • FormType: Functional area code.
  • KeyFields: Key/value pairs for the primary keys (used for SYSPRO 7+).
  • dataFields: Field/value pairs to update.
  • isAdd: (optional) true to insert, false to update. Default: false.

Returns: XmlDocument - result of the SYSPRO e.Net call.

Throws:

  • Exception if SYSPRO version is less than 7.0.

Description: Posts multiple custom field values in one call. Only supported in SYSPRO 7+.


CustomFieldQuery

Signature:

public static XmlDocument CustomFieldQuery(string FunctionalArea, string key, bool UseCache, XPComConfig ComConfig = null)

Parameters:

  • FunctionalArea: SYSPRO area code (e.g., "ORD").
  • key: The record key to query.
  • UseCache: Whether to use the cached version.
  • ComConfig: (optional) A specific communication config.

Returns: XmlDocument - the full XML result of the SYSPRO query.

Description: Returns the raw XML query result from SYSPRO for a given record and functional area.


This site uses Just the Docs, a documentation theme for Jekyll.