Custom Form Fields Overview
Custom Form Fields Overview - Specific to SL Dynamics Integration
US5157 - SL - FCA/FA - Ability to hide forms template/header and expose fields from ERP database tables - Onpoint Group
12/30/2022
Ability to specify form field data from the ERP.
- Limited to scalar values that can be retrieved from the ERP using just the call/work order and or the assignment/trip number.
- Display of these values in the form is static text. Formatting of numbers and dates is configurable.
- They can be placed anywhere in the form.
- Values will be saved along with the other html form values so they remain the same throughout saves of the form regardless of changes in the ERP.
Initial implementation will only be available in the blank template which has been added to FCAdmin and SL FA under US5157.
Data definitions table
Name – The unique name of the record. Used in the form definition input field.
TableName – The table in the ERP where the field is defined
FieldName – The ERP field name
DataType – Used for formatting the output when the form is rendered. Valid values (case sensitive):
- Text – string values
- ShortDate – date only (1/1/2000)
- DateTime – combination of short date followed by short time
- Decimal – floating point format (12.09394)
- Fixed – two decimal point fixed format (12.09)
- Integer – integer format (12)
SelectQuery – Query to retrieve the field value. Markers for the workorder/call numer and/or the assignment/trip numbers will be replaced with actual values.
- Service call: {workordernumber}
- Assignment: {assignnumber}
Example: SELECT smSvcEquipment.Descr FROM smServFault LEFT JOIN smSvcEquipment ON smSvcEquipment.EquipID = smServFault.EquipID WHERE smServFault.LineNbr = {assignnumber} AND smServFault.ServiceCallId = '{workordernumber}'
Definition in the form markup
- The data record name is specified in the “data-erp” attribute.
- Must be in an html input text element
All form fields in the form template that have a “data-erp” attribute will be processed. The record identified by the name specified in the attribute value will be retrieved and the ERP will be queried for the value of the ERP field. Replacement of the actual value in the rendered html will be done through JavaScript. This function only occurs for a new form. Once saved, the form input values will be retrieved just like any other input field value all of which come from the form data record.
To format a text type input field to look like a label in the rendered html use this CSS styling
Final output of the above
Example data
|
Name |
TableName |
FieldName |
DataType |
SelectQuery |
|
CallDate |
smServCall |
ServiceCallDate |
DateTime |
SELECT ServiceCallDate FROM smServCall WHERE ServiceCallID = '{workordernumber}' |
|
CallNumber |
smServCall |
ServiceCallID |
Text |
SELECT ServiceCallID FROM smServCall WHERE ServiceCallID = '{workordernumber}' |
|
EquipDescr |
smSvcEquipment |
Descr |
Text |
SELECT smSvcEquipment.Descr FROM smServFault LEFT JOIN smSvcEquipment ON smSvcEquipment.EquipID = smServFault.EquipID WHERE smServFault.LineNbr = {assignnumber} AND smServFault.ServiceCallId = '{workordernumber}' |