Epicor Function Library Design Template
A function that nobody documented turns into a black box within a year. This template gives each Epicor function a one page design record so the next developer knows what it does, who calls it, and how to test it.
Fill in
Epicor Function Library Design Template
Function Design: AcmeShipping.CalcPromiseDate
Company: Acme Precision Ltd Author: A. Developer Date: 2026-10-20 Primary caller: Method directive
1. Purpose
Return a promise date for a sales order line based on part lead time, warehouse calendar and customer ship via.
2. Signature
Inputs: partNum (string), orderQty (decimal), shipViaCode (string), requestDate (date)
Outputs: promiseDate (date), message (string)
3. Data access
Read: Part, PartPlant, Calendar. Write: none.
Use the Epicor business object or an Ice.Tables reference through the library context rather than raw connections. Keep reads narrow and avoid loops that call the database once per row.
4. Logic
1. Look up plant lead time. 2. Add transit days from ship via. 3. Skip non working days using the plant calendar. 4. Return the date and a message if the request date cannot be met.
5. Error handling
Rule: Return message only
Document every message text and who sees it (end user, log, or calling code).
6. Security and delivery
| Item | Decision |
|---|---|
| Library security | Which security groups may run the function |
| Allow custom code | Is the function written in widgets or in code |
| Environment promotion | Export and import between Test and Live |
| Version note | Describe the change in the library description |
7. Test cases
| Case | Inputs | Expected result | Actual | Pass |
|---|---|---|---|---|
| Normal | ||||
| Boundary | ||||
| Missing data | ||||
| Weekend or holiday |
8. Approvals
Epicor Kinetic functions live in function libraries and can be called from directives, customizations and REST. Names such as method directives and widgets differ slightly by release, so adapt the headings to your version.
Need your customizations documented from source?
Optional: ask how an on-prem assistant can summarize functions and directives for review.
Optional. The tool and every export work without this. No spam.
How to use the template
Fill in one document per function, not per library. Start with the business purpose in plain words, then list inputs and outputs with data types. The logic summary should be steps a reviewer can check, not code. Choose the main caller, because a function used in a method directive has different performance and error concerns than one called from a dashboard. Export to Word or PDF and attach it to the change request or store it with the library description.
- One document per function
- Purpose written for a business reader
- Typed inputs and outputs
- Numbered logic steps
Why design before building
Functions are shared. A BPM, a report and a customization may all call the same one, so a change to its signature breaks callers silently. Writing the signature and the error rule first forces the conversation about who depends on it. Keeping reads narrow also matters: a function called inside a method directive runs during a user transaction, and an extra query per line adds up across large orders.
Reading the sections
The data access section lists tables read and written. If a function writes, call that out clearly, since write functions in directives can cause loops or unintended updates. The error handling rule says whether the function throws, returns a message or logs. Test cases should include a boundary case and a missing data case, as those are where date and quantity logic usually fails.
Common mistakes
Teams often skip documenting output parameters, reuse a generic name like Calc1, or put business constants inside code instead of a UD table or configuration. Another frequent problem is promoting a function to Live without recording what changed. Treat the library description and this document as the version history.
- Avoid vague names such as Calc1 or DoStuff
- Keep constants in configuration, not inside code
- Record the change in the library description
- Test as a normal user, not only as manager
Frequently Asked Questions
What is an Epicor function library?
In Epicor Kinetic a function library is a container of reusable functions created in the Function Maintenance area. Functions can be built with widgets or code, then called from method directives, data directives, customizations and REST.
Should a function write to the database?
It can, but be cautious. Prefer read only functions and let the calling business object or directive do the update. When a function must write, document it and guard against loops where the write triggers the same directive again.
How do I promote a function between environments?
Functions are normally exported from the Test environment as a package and imported into Live, subject to your change control. Record the export date and the version note in the library description so the history is traceable.
How many test cases are enough?
At least one normal case, one boundary case and one missing or invalid data case per function. Add a case for each branch of conditional logic, because untested branches are where problems reach production.
If you want help reviewing a function library or building a private assistant that explains your customizations from the source, Netray can discuss a read-only approach on your own infrastructure.
Related Tools
Epicor BAQ Calculated Field Examples Reference
A searchable cheat sheet of BAQ calculated field expressions you can copy into the Query Builder, grouped by dates, quantities, pricing and text.
EpicorEpicor Application Studio Layer Checklist
A checklist for Kinetic Application Studio layers covering naming, scope, events, rules, security, testing and upgrade impact.
EpicorEpicor Customization Migration Estimator
Count your customizations, BPMs, reports and BAQs and get an hours and cost estimate for retesting and rework in an upgrade or Kinetic move.
EpicorEpicor REST API PowerShell Script Generator
Fill in your server, company and service name to generate a PowerShell script that calls Epicor REST v2 and saves the result to CSV.
More Epicor tools
See all- Epicor Kinetic Customization Change Request Form Template
- Epicor Kinetic Go-Live Cutover Plan Template
- Epicor Kinetic User Access Request Form Template
- Epicor Kinetic BPM Directive Inventory Worksheet
- Epicor Kinetic Scheduled Task Register Worksheet
- Epicor Kinetic Custom Report Inventory Worksheet
- Epicor Kinetic Data Migration Mapping Worksheet
- Epicor Kinetic Data Load Effort Calculator
- Epicor Business Object Services Reference
New to Epicor ERP? Start with the Epicor ERP guide and toolkit, or plan with Training Path Builder, ERP Certification Study Planner, Upgrade Path Planner.
Keep exploring
Free tools
- Epicor Security Group Design WorksheetAn editable worksheet to plan security groups by role and score each for exposure, so over-broad access is visible before audit.
- Prophet 21 Pricing Library Design WorksheetPlan each price page: who it applies to, which product group, the cost basis and multiplier, and the resulting gross margin, before anyone keys it into the system.
- Epicor UD Table Design WorksheetAn editable worksheet for planning user defined tables and fields before you build them in Epicor, with a column count and key check.
ERP fixes and how-tos
- How to create and call an Epicor FunctionHow to create Epicor Functions in Function Studio: define inputs and outputs, write the C# widget, test, then call the function from a BPM directive.
- Epicor Function Custom Code: C# Signature, Parameters and Calling ItWrite custom C# code in Epicor Functions: signature, request and response parameters, libraries, calling from BPM and Application Studio, with working examples.
- Epicor Function Examples: Update a Table, Call It, Schedule ItWorked Epicor Kinetic Function examples: updating a table, calling a function from a BPM, Application Studio or REST, and scheduling a recurring run.
AI on your ERP
- Private AI for Epicor Kinetic Cloud, Outside the Multi-Tenant BoundaryRun a private LLM on Epicor Kinetic private cloud or Kinetic Cloud data via BAQs, REST v2 and Data Fabric, keeping sensitive manufacturing data off shared AI.
- AI for Epicor Kinetic Job Shops: Quote History, Job Variance and Schedule RiskPrivate AI for Epicor Kinetic job shops: quote-to-job history, JobHead and JobOper variance, subcontract delays and schedule risk, via REST and BAQs.
Integrations
- How to use ChatGPT with Epicor KineticConnect ChatGPT to Epicor Kinetic through a custom GPT with Actions, an exported dataset, or a private gateway. Covers BAQs, auth, data controls and when to go private.
- How to add an AI chatbot to Epicor KineticAdd an AI chatbot to Epicor Kinetic: an internal assistant for planners and buyers or a customer portal bot, grounded in BAQs and runnable fully on-prem.
Software
- Epicor KineticEpicor Kinetic explained for manufacturers: modules, REST API, BAQs, deployment, strengths, limits and alternatives to compare before choosing or upgrading.
- Epicor CPQEpicor CPQ is a cloud configure-price-quote product with visual 3D configuration for manufacturers. Modules, ERP integrations and alternatives explained.