The Challenge – Adding Smart Fields to Custom Reports
Due to the dynamic nature of our client’s business and financial structure, the need for creating a customized financial report was critical. Our client’s financial data encompassed complex calculations, which needed to be stored in a Custom JDE Table. This customization involved grouping each company, business unit, ledger type, and accounting category by financial period in each row.
During the development process, I came across the challenge of creating a custom group section report. This report involved populating calculated financial data for all periods in a single row, while the data stored in the database would need to be organized by column.
To eliminate redundancy of code, my team recognized the solution of creating a Smart Field. A Smart Field is essentially a data dictionary item that has a business function attached to it. The Business Function includes name mapping, which maps the source for each parameter of the Business Function data structure. For this customization, the Smart Field displayed the dollar amount for the specific period and financial year for each grouping. Below is the step by step process to create a Smart Field for custom group section reports.
The Step by Step Process
Create a data dictionary item and define the data item as glossary group ‘K’. This data item will serve as the data dictionary column in Report to hold the return value (calculated value) from the Business Function. Note that you can use any existing data item with glossary group K, which is not necessarily needed to create a new data item.
Create a data structure. A data structure is a list of parameters used to pass values between your report and the database tables. It contains all data items required to complete the function of the smart field.
Define named mapping. The named mapping defines the source for each parameter (or data item) of the data structure. For example, source values are determined for the prompts, tables, processing options and return values.
Create a ‘C Business Function’ (or NER object), and add the data structure. The Business Function will execute the required business logic.
Add ‘Name Mapping’ to the DD item.
Create a Smart Field Template. On JD Edwards Solution Explorer, under ‘advance report setup’, select ‘Smart Field Templates.’ Name the Smart Field Template and provide a description. Afterwards, select the data item in the grid.
Create a Report Director Template. On JD Edwards Solution Explorer, under advance report setup, select ‘Report Director Templates.’
Update the report view option and Smart Field Selection. Following this, go to the view tab, then ‘user option’ on report design aid.
Click on the check box titled: ‘allow Smart Field Template selection.’
Create a group section with the provided business view. Double-click on section, or go to ‘section properties.’ On the Smart Field Template drop down list, select the ‘Report Director Template.’.
On Insert tab, you can see Smart Field is enabled. From here, you can select the field and drop down anywhere in this section.
Most of the time, developers mistakenly think that Smart Fields can only be used in tabular reports in JD Edwards. In reality, it can be used in all JD Edwards report types, group, columnar and tabular.