Shop Floor Insight’s barcode scanning web client can be extended to display additional Business Central fields in its dispatch lists. This article refers to instructions on how to add columns to the barcode scanning interface that would typically be accessible via https://yourservername:8000/TCM, this article is not referring to the Business Central phone/tablet dispatch interfaces, nor the Warehouse Insight app-on for Shop Floor Insight that allows full column customization.
Adding a field requires changes in two places:
- Expose the field through the appropriate Shop Floor Insight Business Central web service page.
- Add the field to the corresponding Shop Floor Insight web client JavaScript model and dispatch view.
The objects and JavaScript files you modify depend on whether you are extending the Job Task Dispatch or the Production Order Dispatch.
Before You Begin
You will need:
- A Business Central AL extension in which you can create a page extension.
- Access to the server where the Shop Floor Insight service is installed.
- Permission to modify files in the Shop Floor Insight service installation folder.
- Permission to restart the Shop Floor Insight service.
For custom fields, use simple alphanumeric names whenever possible.
For example:
MyCustomField
is preferable to:
My Custom Field
My Custom. Field
Custom_Field
or other names containing spaces or punctuation.
This applies particularly to the field control name exposed by the Shop Floor Insight web service. Using a simple alphanumeric name makes it possible to use exactly the same field name in Business Central and in the JavaScript client.
The examples below use a field named:
MyCustomField
Extending the Job Task Dispatch
Use this procedure when you want to add columns to the Shop Floor Insight Job Dispatch used for Business Central jobs and job tasks.
The Business Central web service page is:
Page 23044227 “SFI WS – Job Task”
This page is based on the Business Central Job Task table.
The corresponding Shop Floor Insight web client files are:
HTML\Ext\app\model\JobDispatchModel.js
HTML\Ext\app\view\JobDispatch.js
Step 1: Extend the Business Central Web Service Page
Create a page extension for:
23044227 "SFI WS - Job Task"
Add each field that you want the Shop Floor Insight client to receive.
For example, assuming MyCustomFieldis available from the Job Task record:
pageextension 50100 "My SFI Job Task Ext" extends "SFI WS - Job Task"
{
layout
{
addlast(General)
{
field(MyCustomField; Rec."My Custom Field")
{
ApplicationArea = All;
Caption = 'MyCustomField';
ToolTip = 'Specifies the reference to the custom field that you want to expose.';
}
}
}
}
The important part for the Shop Floor Insight client is the page field name:
MyCustomField
That is the name you will also use in the JavaScript model and view.
The underlying Business Central table field does not have to have the same name. For example:
field(MyCustomField; Rec."My Custom Field")
allows an underlying AL field containing spaces to be exposed to the Shop Floor Insight client using the simpler name .MyCustomField
Publish and install your Business Central extension before continuing.
Step 2: Locate the Shop Floor Insight Web Client Files
On the Shop Floor Insight service computer, open the Shop Floor Insight service installation folder.
For a standard Production installation, this is commonly under:
C:\Program Files\Insight Works\Shop Floor Insight - Production
From the service folder, navigate to:
HTML\Ext\app
The Job Task dispatch model is located at:
HTML\Ext\app\model\JobDispatchModel.js
The Job Task dispatch view is located at:
HTML\Ext\app\view\JobDispatch.js
Step 3: Add the Field to JobDispatchModel.js
Open:
HTML\Ext\app\model\JobDispatchModel.js
The model contains a fields array containing the values returned by the Job Task web service.
For example, the standard model contains fields such as:
'Job_No',
'Job_Task_No',
'Description',
'Bill_to_Name',
'Assigned_To_No',
'Assigned_To_Name',
Add your field to this array:
'MyCustomField,
For example:
fields:
[
'Key',
'Job_No',
'Job_Task_No',
'Description',
'MyCustomField',
'Job_Task_Type',
'Bill_to_Name',
'Assigned_To_No',
'Assigned_To_Name'
]
The JavaScript field name must match the property returned by the Business Central web service.
If you followed the recommended naming convention and exposed the AL page field as MyCustomField, use:
'MyCustomField'
Existing Field Names Containing Spaces or Punctuation
Shop Floor Insight’s existing web service fields demonstrate that Business Central/OData property names may differ from the AL display name. For example:
Job No. becomes Job_No
and:
Assigned-To No. becomes Assigned_To_No
For new custom fields, avoid this issue by using an alphanumeric page field name with no spaces or punctuation.
If you are working with an existing field whose exposed name contains spaces or punctuation, use the actual property name returned by the Business Central web service rather than assuming the JavaScript name.
Step 4: Add the Column to JobDispatch.js
Open:
HTML\Ext\app\view\JobDispatch.js
The buildColumns function defines the columns displayed in the Job Dispatch grid.
Add a new column definition.
For example:
{
dataIndex: 'MyCustomField',
text: app.classes.Localizer.getText('MyCustomField'),
flex: 1,
hidden: false
},
dataIndex must match the field name you added to JobDispatchModel.js.
The hidden property controls whether the field is initially visible:
hidden: false
displays the column by default.
hidden: true
makes the column available but initially hidden.
The flex value controls the relative width of the column.
Use the existing definitions in JobDispatch.js as examples for dates, Boolean fields, and other values that require a renderer.
For example, the standard Job Dispatch uses:
renderer: function (value)
{
return app.classes.Formatter.dateRenderer(value);
}
for date fields and:
renderer: function (value)
{
return app.classes.Formatter.booleanRenderer(value, false);
}
for Boolean fields.
Step 5: Restart and Test
After saving the JavaScript files:
- Restart the Shop Floor Insight service.
- Refresh the Shop Floor Insight web client in the browser.
- Open the Job Dispatch.
- Confirm that the new column appears.
- Confirm that the expected Business Central value is being returned for each row.
If the column appears but contains no data, verify that the field is being returned by page 23044227 before troubleshooting the JavaScript view.
Extending the Production Order Dispatch
Use this procedure when you want to add columns to the standard Shop Floor Insight Production Order Dispatch.
This is a different web service and client model from Job Task Dispatch.
The Business Central web service page is:
Page 23044214 “SFI WS – Dispatch”
This page is based on:
Prod. Order Routing Line
The corresponding Shop Floor Insight web client files are:
HTML\Ext\app\model\DispatchModel.js
HTML\Ext\app\view\Dispatch.js
Do not modify JobDispatchModel.js or JobDispatch.js when adding a field specifically to the Production Order Dispatch.
Step 1: Extend the Production Order Dispatch Web Service Page
Create a page extension for:
23044214 "SFI WS - Dispatch"
For example:
pageextension 50101 "My SFI Dispatch Ext" extends "SFI WS - Dispatch"
{
layout
{
addlast(General)
{
field(MyCustomField; Rec."My Custom Field")
{ ApplicationArea = All;
Caption = 'MyCustomField';
ToolTip = 'Specifies the customer reference.';
}
}
}
}
Page 23044214 uses the Prod. Order Routing Line record, so the value used by the field must be available in the context of that record.
Publish and install the AL extension.
Step 2: Locate DispatchModel.js
From the Shop Floor Insight service installation folder, navigate to:
HTML\Ext\app\model\DispatchModel.js
For example, a Production installation may have the complete path:
C:\Program Files\Insight Works\Shop Floor Insight - Production\HTML\Ext\app\model\DispatchModel.js
This model contains standard fields such as:
'Routing_No',
'Operation_No',
'Work_Center_No',
'Description',
'Prod_Order_No',
'Prod_Item_No',
'Prod_Item_Description',
Add the new field:
'MyCustomField',
For example:
fields:
[
'ID',
'Key',
'Routing_No',
'Operation_No',
'Work_Center_No',
'Description',
'Prod_Order_No',
'Prod_Item_No',
'MyCustomField'
]
Again, the model field must match the property returned by the Business Central web service.
Step 3: Add the Column to Dispatch.js
Open:
HTML\Ext\app\view\Dispatch.js
For example:
C:\Program Files\Insight Works\Shop Floor Insight - Production\HTML\Ext\app\view\Dispatch.js
The buildColumns function contains the column definitions for the Production Order Dispatch.
Add your new column:
{
dataIndex: 'MyCustomField',
text: app.classes.Localizer.getText('MyCustomField'),
flex: 2,
hidden: false
},
For example, it could be placed alongside the standard Production Order fields:
{
dataIndex: 'Prod_Order_No',
text: app.classes.Localizer.getText('Prod. Order No.'),
flex: 2,
hidden: false
},
{
dataIndex: 'MyCustomField',
text: app.classes.Localizer.getText('MyCustomField'),
flex: 2,
hidden: false
},
{
dataIndex: 'Prod_Item_No',
text: app.classes.Localizer.getText('Item No.'),
flex: 2,
hidden: false
},
Step 4: Restart and Test
After saving the files:
- Restart the Shop Floor Insight service.
- Refresh the Shop Floor Insight client in the browser.
- Open the Production Order Dispatch.
- Confirm that the column appears.
- Confirm that each row displays the expected value.
Choosing the Correct Dispatch Objects
Use the following mapping when determining what to extend:
| Dispatch being customized | Business Central page | Source record | JavaScript model | JavaScript view |
|---|---|---|---|---|
| Job Task Dispatch | 23044227 “SFI WS – Job Task” | Job Task | JobDispatchModel.js |
JobDispatch.js |
| Production Order Dispatch | 23044214 “SFI WS – Dispatch” | Prod. Order Routing Line | DispatchModel.js |
Dispatch.js |
The two dispatch types use separate Business Central web services and separate JavaScript models. A field added to one does not automatically become available to the other.
Field Naming Recommendations
For custom Shop Floor Insight dispatch fields, use simple alphanumeric field names whenever possible.
Recommended:
MyCustomField ProductionComment PriorityCode DrawingNumber
Avoid:
Customer Reference
Customer.Reference
Customer_Reference
Customer-Reference
A simple name allows the same identifier to be used consistently in all three locations:
AL page extension
field(CustomerReference; Rec."Customer Reference")
JavaScript model
'CustomerReference',
JavaScript view
dataIndex: 'CustomerReference'
This minimizes problems caused by the property-name normalization that occurs between Business Central web service fields and the JavaScript client.
Troubleshooting
The column does not appear
Verify that:
- The correct JavaScript view was modified.
dataIndexwas added to the appropriate view.- The same field exists in the corresponding model.
- The Shop Floor Insight service was restarted.
- The browser client was refreshed.
For Job Task Dispatch, check:
JobDispatchModel.js
and:
JobDispatch.js
For Production Order Dispatch, check:
DispatchModel.js
and:
Dispatch.js
The column appears but is blank
Confirm that the Business Central web service is actually returning the field.
For Job Task Dispatch, the field must be exposed through:
23044227 "SFI WS - Job Task"
For Production Order Dispatch, the field must be exposed through:
23044214 "SFI WS - Dispatch"
If the web service does not return the value, changing the JavaScript model or view will not populate it.
The JavaScript model contains the field but the grid does not show it
Adding a field to JobDispatchModel.js or DispatchModel.js only makes the property available to the client model.
You must also add a column with a matching dataIndex to:
JobDispatch.js
or:
Dispatch.js
to display it.
The field name in JavaScript does not match the AL field name
The JavaScript name must match the property exposed by the Business Central web service.
The standard Shop Floor Insight implementation contains examples such as:
Job No. → Job_No
Job Task No. → Job_Task_No
Prod. Order No. → Prod_Order_No
Assigned-To No. → Assigned_To_No
For new fields, the simplest approach is to expose them from the AL page using an alphanumeric field name such as CustomerReference, which can then be used unchanged in the JavaScript model and view.
Still need help?
Ask other Business Central users in the Insight Works community, or send the details to the support team. Include the steps you took and any error message you saw.