65
Infor Factory Track CSI Extensibility Guide

Infor Factory Track CSI Extensibility Guide

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Infor Factory Track CSI Extensibility Guide

Infor Factory Track CSI Extensibility Guide

Page 2: Infor Factory Track CSI Extensibility Guide

Copyright © 2019 Infor

Important Notices The material contained in this publication (including any supplementary information) constitutes and contains confidential and proprietary information of Infor.

By gaining access to the attached, you acknowledge and agree that the material (including any modification, translation or adaptation of the material) and all copyright, trade secrets and all other right, title and interest therein, are the sole property of Infor and that you shall not gain right, title or interest in the material (including any modification, translation or adaptation of the material) by virtue of your review thereof other than the non-exclusive right to use the material solely in connection with and the furtherance of your license and use of software made available to your company from Infor pursuant to a separate agreement, the terms of which separate agreement shall govern your use of this material and all supplemental related materials ("Purpose").

In addition, by accessing the enclosed material, you acknowledge and agree that you are required to maintain such material in strict confidence and that your use of such material is limited to the Purpose described above. Although Infor has taken due care to ensure that the material included in this publication is accurate and complete, Infor cannot warrant that the information contained in this publication is complete, does not contain typographical or other errors, or will meet your specific requirements. As such, Infor does not assume and hereby disclaims all liability, consequential or otherwise, for any loss or damage to any person or entity which is caused by or relates to errors or omissions in this publication (including any supplementary information), whether such errors or omissions result from negligence, accident or any other cause.

Without limitation, U.S. export control laws and other applicable export and import laws govern your use of this material and you will neither export or re-export, directly or indirectly, this material nor any related materials or supplemental information in violation of such laws, or use such materials for any purpose prohibited by such laws.

Trademark Acknowledgements The word and design marks set forth herein are trademarks and/or registered trademarks of Infor and/or related affiliates and subsidiaries. All rights reserved. All other company, product, trade or service names referenced may be registered trademarks or trademarks of their respective owners.

Publication Information Release: Infor Factory Track CSI Extensibility Guide

Publication date: August 30, 2019

Page 3: Infor Factory Track CSI Extensibility Guide

Contents

Infor Factory Track CSI Extensibility Guide Guide | 3

Contents

About this guide ................................................................................................................................... 7

Organization ..................................................................................................................................... 7

Contacting Infor................................................................................................................................ 7

Chapter 1 Integration Architecture ................................................................................................ 9

Chapter 2 Extending Factory Track to utilize CloudSuite Industrial UETs ............................. 10

Example ......................................................................................................................................... 10

CloudSuite Industrial changes ....................................................................................................... 11

Factory Track changes .................................................................................................................. 11 Modifying the FT IDO .............................................................................................................. 11 Modifying the FT forms ............................................................................................................ 13 Verify the changes ................................................................................................................... 13

Chapter 3 Extending Factory Track to update additional information in CloudSuite Industrial 14

Example ......................................................................................................................................... 14

CloudSuite Industrial changes ....................................................................................................... 15 Creating a CloudSuite Industrial table ..................................................................................... 15 Creating a CloudSuite Industrial IDO Custom Assembly Extension class ............................. 15 Creating a new CloudSuite Industrial IDO .............................................................................. 16 Creating a CloudSuite Industrial IDO Method ......................................................................... 17

Factory Track changes .................................................................................................................. 18 Creating an IDO Extension class ............................................................................................ 19 Creating a new IDO ................................................................................................................. 20 Creating a new IDO Method .................................................................................................... 21 Modifying the Factory Track Pick N Ship form ........................................................................ 22 Verifying the data populated in CSI ......................................................................................... 23

Chapter 4 Extending Factory Track to print additional information on the Barcode level .... 24

Page 4: Infor Factory Track CSI Extensibility Guide

Contents

4 | Infor Factory Track CSI Extensibility Guide Guide

Example ......................................................................................................................................... 24 Label Printing process in Factory Track .................................................................................. 24

Creating records in the label printing tables ..................................................................... 25

Factory Track changes .................................................................................................................. 26 Overview: Using the AES system to build extensions ............................................................ 26 Creating an IDO extension class ............................................................................................. 26 Updating the IDO Assembly information ................................................................................. 27 Creating a new IDO Method .................................................................................................... 28 Creating IdoPostEvent............................................................................................................. 28 Creating an Event Action ......................................................................................................... 30 Testing Extensions .................................................................................................................. 36

Chapter 5 Extensions using new Factory Track 7 architecture without reviews ................... 39

Overview: CSI SQL Views ............................................................................................................. 39

In Collection Validator .................................................................................................................... 39 Example ................................................................................................................................... 39

Updating the IDO Assembly information ........................................................................... 41 Adding IDO to the Factory Track web service connector form ......................................... 41

Utilizing the existing CSI IDO Method in the Factory Track forms ................................................ 42 Example ................................................................................................................................... 42

Combining Data from CSI and FT ................................................................................................. 44 Overview: Combining data without views ................................................................................ 44 Example ................................................................................................................................... 45

Creating a new CSI IDO Method ...................................................................................... 46 Creating FT IDO Extension Class Method ........................................................................ 47 Creating a new IDO Method on Factory Track ................................................................. 47

Handling the SQL keywords and operators ................................................................................... 48

Chapter 6 Extending the existing stored procedure .................................................................. 49

Overview: Creating an extended stored procedure ....................................................................... 49 Example ................................................................................................................................... 49

Creating an extended stored procedure ........................................................................................ 50

Chapter 7 Moving the existing Extensions using the Mongoose tools ................................... 51

Importing and exporting IDOs, IDO Extension Classes, and Property Classes ........................... 51

FormSync Utility ............................................................................................................................. 52

Appendix A Creating new Extension Class assemblies in Mongoose .................................... 53

Page 5: Infor Factory Track CSI Extensibility Guide

Contents

Infor Factory Track CSI Extensibility Guide Guide | 5

Appendix B AddTrackingNumber.cs ........................................................................................... 61

Appendix C ICTrackUpdate.cs ...................................................................................................... 63

Appendix D InsertIntoLabelExtensionTable.cs .......................................................................... 64

Page 6: Infor Factory Track CSI Extensibility Guide
Page 7: Infor Factory Track CSI Extensibility Guide

About this guide

Infor Factory Track CSI Extensibility Guide Guide | 7

About this guide

This document is intended to provide information on extending the functionalities of Infor Factory Track to meet some of the customization needs. This document covers few common customization scenarios and tries to explain them using examples.

Organization This table shows the chapters of the guide:

Section Description

Extending Factory Track to utilize CloudSuite Industrial UET’s

Discusses ability to add UET’s (User Extended Table Fields) to existing tables

Extending Factory Track to update extra information in CloudSuite Industrial

Discusses extending Factory Track to update extra information in CloudSuite Industrial

Extending Factory Track to print additional Information on the Barcode Label

Explains the case where additional information needs to be printed

Extensions Using New Factory Track 7 Architecture Without Using Views

Explains changes to extensions which use the new architecture without using SQL views

Extending Existing Stored Procedures Explains how to extend existing Stored Procedures in Mongoose

Moving Existing Extensions Using Mongoose Tools Discusses Mongoose tools for moving Extensions

Contacting Infor If you have questions about Infor products, go to Infor Concierge at https://concierge.infor.com/ and create a support incident.

Page 8: Infor Factory Track CSI Extensibility Guide

About this guide

8 | Infor Factory Track CSI Extensibility Guide Guide

If we update this document after the product release, we will post the new version on the Infor Support Portal. To access documentation, select Search > Browse Documentation. We recommend that you check this portal periodically for updated documentation.

If you have comments about Infor documentation, contact [email protected].

Page 9: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 9

Chapter 1 Integration Architecture

This image displays the data flow between Factory Track and CloudSuite Industrial:

The integration between Factory Track and CloudSuite Industrial uses an IDO connection, which manages the information flow between Factory Track and the ERP system. The IDO Extension class assemblies enable Factory Track to send information to and receive responses from CloudSuite Industrial, using a CloudSuite Industrial automation license.

To establish the integration, you must:

1 Configure site parameters in Factory Track.

2 Configure document integration parameters to review the documents from PLM in Factory Track (optional).

To configure these parameters, refer to the appropriate Infor Factory Track CloudSuite Industrial Integration Guide.

Page 10: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

10 | Infor Factory Track CSI Extensibility Guide Guide

Chapter 2 Extending Factory Track to utilize CloudSuite Industrial UETs

Infor Mongoose allows customer to add UETs (User Extended Table Fields) to the existing tables. As part of the customization process, UETs may be added to CloudSuite Industrial tables. This example is provided to show required changes in Factory Track to utilize the UET created in CloudSuite Industrial.

Example A new field ‘UET’ is added to the Item master table in CloudSuite Industrial to capture the default number of items for each container. The requirement is to display this additional UET information in Factory Track transactions.

Page 11: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 11

CloudSuite Industrial changes A new UET, uf_item_qty, is added to the Item master table. This UET is defined to store the specified default number of Items that can fit in a container.

Note: The UET is automatically available in SLItems IDO and can be added to the CloudSuite Industrial forms.

Factory Track changes A new UET is created on CloudSuite Industrial. This UET is not directly available on Factory Track.

To make the uf_item_qty UET available in Factory Track forms, perform these steps:

1 Modify the FT IDO

2 Modify the FT forms

3 Verify the changes

Modifying the FT IDO To modify the IDO level:

1 Create an IDO Project, using the IDO Projects form.

2 Set the Project name to FTExtension:

Note: The Access As value may be prefixed to the created Project. For example, MESFTExtension.

3 Click the New IDO option on the IDO Project form. The New IDO Wizard form is displayed.

4 Specify the IDO Name as ICSLItems_Ext.

5 Set the Extends field to ICSLItems.

6 Select the Extend and Replace check box.

Page 12: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

12 | Infor Factory Track CSI Extensibility Guide Guide

7 Click Finish. IDOs form is displayed.

8 Click the New Property option.

9 Select the Unbound option in the Select The Binding for The New Property section on the New Property form.

10 Add a new property to the ICSLItems_Ext IDO for the UET property created in CloudSuite Industrial. Specify itmuf_item_qty in the Property Name field wherein:

• Itm is the alias name of table in the IDO in CSI • uf_item_qty is the name of the UET created in CSI

Note: The property name is created using the Property Naming Rule and is a combination of the alias name and the UET name of the property.

11 Sign out from the application and sign in again to clear the IDO cache.

Note: In case of cloud environment, IDO cache can be cleared using Unload Farm IDO Metadata.

Page 13: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 13

Modifying the FT forms The new field (uf_item_qty) in the Factory Track IDO can be added to the Factory Track forms.

To add the new field to the Item Inquiry Transaction form:

1 Add an Edit field to the Item Inquiry form.

2 If the IDO is a collection on the form (For example, Item Inquiry form)

a Bind the edit box to itmuf_item_qty property.

b Execute step 4

3 If the IDO is not a collection on the form (Ex. Stock Move form), then

a Create new vUFItemQty variable form.

b Bind the edit box to vUFItemQty variable.

c Access the WMItemVal validator.

d Add vUFItemQty=itmuf_item_qty to Set Value Parameters.

4 Save the changes.

Verify the changes To verify the changes in the Factory Track form:

1 Perform a transaction using the form that displays the UF Item Qty field.

2 Ensure that the data is populated correctly in CloudSuite Industrial.

Page 14: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

14 | Infor Factory Track CSI Extensibility Guide Guide

Chapter 3 Extending Factory Track to update additional information in CloudSuite Industrial

This section describes the process of extending Factory Track to update additional information in CloudSuite Industrial. Most of the Factory Track transactions result in a transactional update in CloudSuite Industrial.

Example Capture tracking numbers for customer shipments in Factory Track and updating this data in CloudSuite Industrial. The Pick N Ship transaction in Factory Track is enhanced to capture the customer shipment number. This data is updated in the ShipmentTracking table (customization table) which contains the tracking numbers, in CloudSuite Industrial.

This customization requires changes in the CloudSuite Industrial and the Factory Track application. This section describes the changes required in the CloudSuite Industrial and Factory Track applications.

Factory Track

ICSLShipmentTracking IDO

Factory Track Form

Event Handler

CloudSuite Industrial

ShipmentTracking IDO

SQL Table (ShipmentTracking)

AddTrackingNumber IDO Custom Assembly

Extension Class

IDO Method (AddTrackingNumber)

AddTrackingNumber IDO Custom Assembly

Extension Class

IDO Method (AddTransNum) IDO Communication

Page 15: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 15

CloudSuite Industrial changes This section describes the process for the customization of CloudSuite Industrial. You can skip these steps, if already implemented.

Execute these steps:

1 Create a CloudSuite Industrial table.

2 Create a CloudSuite Industrial IDO Custom Assembly Extension class.

3 Creating a new CloudSuite Industrial IDO.

4 Create a CloudSuite Industrial IDO Method.

Note: Infor Mongoose appends the Access As value at the beginning of Table names, IDO names, Assembly names, and so on. Verify the item name after saving the data to ensure correct usage of the item name.

Creating a CloudSuite Industrial table To create a table:

1 Enter ShipmentTracking SQL as the Table name, using the Sql Tables Form.

2 Save the table and click the Column option on the Sql Tables Form.

3 Add the columns listed in the following table to the ShipmentTracking table.

Column Name Data Type Nullable Length

co_num CoNumType Checked N/A

co_line CoLineType Checked N/A

Datetime DateType Checked N/A

track_num nvarchar Checked 200

Creating a CloudSuite Industrial IDO Custom Assembly Extension class To create an Extension class:

1 Create a new extension class project. For more information see:

Note:

• Appendix A – Creating new Extension Class assemblies in Mongoose for details about creating a Custom Assembly in Mongoose.

Page 16: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

16 | Infor Factory Track CSI Extensibility Guide Guide

• The IDO Development Guide for additional information about creating Extension Class Projects.

2 Access the IDO Extension Class Assemblies form.

3 Specify this information:

• Assembly Name as AddTrackingNumber • Assembly Type as Build From Source • Language as C# • FileName as AddTrackingNumber • References as System.data.dll to the end

4 Click Source Code.

a Specify AddTrackingNumber in the FileName field.

b Copy the example code specified in Appendix B.

c Save the changes.

5 Click Build Assembly.

Note: The IDO extension class contains the logic required to save the information in the Shipment Tracking table.

Creating a new CloudSuite Industrial IDO To create a new IDO:

1 Create a new IDO Project, using the SLShipmentTrackingExample IDO Projects form.

Page 17: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 17

2 Click New IDO on the IDO Project page.

3 Specify this information:

• Project Name as SLShipmentTrackingExample • Primary Base Table as ShipmentTracking • Table Alias as SLST • IDO Name as SLShipmentTracking

4 Update this information:

• IDO Assembly Name as AddTrackingNumber

• Ext Class Name as AddTrackingNumberUpdate

• Ext Class Namespace as AddTrackingNumber

Note: The values mentioned are same as defined in step 2.

Creating a CloudSuite Industrial IDO Method To create an IDO method:

1 Access the SLShipmentTracking IDO.

2 Click New Method.

3 Set Method Type to HandCoded - Standard OR Extension Class - Standard Method

4 Set Method Name to AddTrackingNumber (Manually specify the Function Name)

5 Click OK.

6 Click Methods on IDO.

Page 18: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

18 | Infor Factory Track CSI Extensibility Guide Guide

7 Add the following parameters listed in the table:

Parameter Name Sequence User Data Type Data Type Length/Prec. Input Parameter

co_num 1 Variant VARCHAR 10 Checked

co_line 2 Variant SHORT Checked

TrackNum 3 Variant VARCHAR 200 Checked

8 Save the changes.

Factory Track changes Factory Track uses Mongoose IDO communication technology to invoke the CloudSuite Industrial IDO/IDO methods. The IDO/IDO methods created in the CloudSuite Industrial are not directly available in Factory Track.

To make these methods available in Factory Track:

1 Create an IDO Extension Class.

Page 19: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 19

2 Create an IDO.

3 Create an IDO Method.

4 Modify the Factory Track Pick N Ship form.

5 Verify the data populated in CSI.

Note: Infor Mongoose appends the Access As value at the beginning of Table names, IDO names, Assembly names, and so on. Verify the item name after saving the data to ensure correct usage of the item name.

Creating an IDO Extension class To create an IDO Extension class:

1 Create a new Extension class project. For more information, see:

Note:

• Appendix A which explains the process of creating new Extension Class assemblies in Mongoose.

• The IDO Development Guide for additional information about creating Extension Class Projects.

2 Access the IDO Extension Class Assemblies form.

3 Specify this information:

• Assembly Name as ICTrackUpdate • Assembly Type as Build From Source • Language as C# • FileName as ICTrackUpdate • References as System.data.dll, ICTrackUpdate.dll to the end.

Page 20: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

20 | Infor Factory Track CSI Extensibility Guide Guide

4 Click Source Code.

a Specify ICTrackUpdate in the FileName field.

b Copy the example code specified in Appendix B.

c Save the changes.

5 Click Build Assembly.

Note: The ICERPLayer extension class is a core Factory Track assembly that communicates with CloudSuite Industrial. This assembly has reusable methods.

Creating a new IDO 1 Create a new IDO Project, using the SLShipmentTrackingExample IDO Projects form.

2 Click New IDO on the IDO Project page.

3 Specify this information:

• Project Name as SLShipmentTrackingExample • Primary Base Table as AccessAs • IDO Name as ICSLShipmentTracking • Table Alias as ACC.

4 Update this information:

• IDO Assembly Name as ICTrackUpdate

• Ext Class Name as ERPTrackUpdate • Ext Class Namespace as ICTrackUpdate.

Page 21: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 21

Creating a new IDO Method To create an IDO method:

1 Click New Method.

2 Set Method Type to Extension Class - Standard Method.

3 Set Method Name to AddTransNum (Manually specify the Method name).

4 Click OK.

5 Click Methods on IDO.

6 Add the following parameters listed in the table:

Parameter Name Sequence User Data Type Data Type Length/Prec. Input Parameter

co_num 1 Variant VARCHAR 10 Checked

co_line 2 Variant SHORT Checked

TrackNum 3 Variant VARCHAR 200 Checked

7 Save the changes.

Page 22: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

22 | Infor Factory Track CSI Extensibility Guide Guide

Modifying the Factory Track Pick N Ship form The Pick N Ship transaction form can to be modified to invoke the new IDO method.

1 Add an Edit field to the Pick N Ship Transaction form with the Name: TrackEdit

2 Add a New Event Handler to invoke the IDO method created with these values:

• Event: CustomerorderPickPostToERP.

Page 23: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 23

• Type: Method Call.

• Parameters: ICSLShipmentTracking.AddTransNum(PARMS(VAR C(CustOrdEdit), VAR C(OrderLineEdit), VAR C(TrackEdit)) ).

3. Modify the new event handler to second sequence as displayed:

When the Pick N Ship transaction is processed, the tracking number captured on the form is successfully updated in the ShipmentTracking table of CloudSuite Industrial.

Verifying the data populated in CSI To verify the data:

1 Create a new Grid Only form based on SLShipmentTracking IDO, in CSI.

2 Execute these steps to create the form:

a Set the form type to Grid Only.

b Add a grid column for co_line, co_num, and track_num, and Datetime using Form Wizard.

c Click Finish to create the form.

d Modify the initial command to Refresh.

e Save the changes.

3 Access the form and verify that the data specified on the Pick N Ship form is being displayed on the new CSI form.

Page 24: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

24 | Infor Factory Track CSI Extensibility Guide Guide

Chapter 4 Extending Factory Track to print additional information on the Barcode level

Factory Track provides various information that can be printed on a Barcode label. This information is captured in the label_print_dtl table. This section describes the process of adding additional information that requires to be printed on the Barcode label.

The integration between Factory Track and CloudSuite Industrial uses an IDO connection, which manages the information flow between Factory Track and the ERP system.

Example A new extensibility table ic_label_print_extension is provided to support customers with additional information. This table allows customers to insert data in the ic_label_print_extension table. Factory Track must be modified to include additional information in the file created for the Bartender. The requirement is to modify Factory Track to print the Item Unit Weight and the Item Lead Time forms on the Barcode Label.

Label Printing process in Factory Track In Factory Track, some transactions can be configured to print labels. During the Label Printing process, Factory track execute these steps:

1 Create records in the label printing tables of the Factory Track database.

2 Create a file with instructions and data using the label printing tables for the Bartender software to print a label.

3 Use the Label Interface form to configure the file creation for:

• On-premise installation, the Interface type is set to File.

• Cloud installation, the Interface type is set to Database Only.

Page 25: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 25

Creating records in the label printing tables Factory Track populates data in these tables in the application database:

• ic_label_print_history table contains data to provide Bartender instructions (for example, number of copies, format name, and printer name).

• ic_label_print_dtl table contains the actual data to be printed (for example, item, warehouse, and order number)

The data in these tables is used to print the file with data and instructions.

The ic_label_print_dtl table contains more than 90 different fields of information, that can be printed on a label. These fields meet most of the customer label printing data requirements.

Factory Track

ICLabelPrintExtensions IDO

Factory Track Form

Item Unit Weight and

Item Lead Time

InsertIntoLabelExtensionTable IDO Custom Assembly

Extension Class

IDO Method (AddLabelDetails) IdoPostEvent Process

Transaction Event Action

SQL Table (ic_label_print_extension)

Page 26: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

26 | Infor Factory Track CSI Extensibility Guide Guide

Factory Track changes Factory Track uses AES system to invoke the CloudSuite Industrial IDO/IDO methods. The IDO/IDO methods created in the CloudSuite Industrial are not directly available in Factory Track. Factory Track invokes the ICInsertLabelPrintDetailsSp method to insert data into the appropriate Label Print tables.

Overview: Using the AES system to build extensions AES (Application Event System) provides the capability to build an extension to insert data in the ic_label_print_extension table.

Factory Track invokes the ICInsertLabelPrintDetailsSp method to insert data into the appropriate Label Print tables. AES invokes the IdoPostEvent event after the ICInsertLabelPrintDetailsSp method has been executed. As part of the extension, a new event handler can be added to the IdoPostEvent event that can insert additional data in the ic_label_print_extension table.

To build an extension, perform these steps:

1 Create IDO Extension Class.

2 Update the IDO Assembly Information.

3 Create New IDO Method.

4 Create IdoPostEvent.

5 Create Event Actions.

6 Test Extensions.

Note: Infor Mongoose appends the Access As value at the beginning of Table names, IDO names, Assembly names, and so on. Verify the item name after saving the data to ensure correct usage of the item name.

Creating an IDO extension class To create an IDO Extension class:

1 Create a new Extension class project. For more information, see:

Note:

• Appendix A which explains the process of creating new Extension Class assemblies in Mongoose.

• The IDO Development Guide for additional information about creating Extension Class Projects.

2 Access the IDO Extension Class Assemblies form.

Page 27: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 27

3 Specify this information:

• Assembly Name as InsertIntoLabelExtensionTable • Assembly Type as Build From Source • Language as C# • FileName as InsertIntoLabelExtensionTable • References as System.data.dll to the end

4 Click Source Code.

a Specify InsertIntoLabelExtensionTable in the FileName field.

b Copy the example code specified in Appendix D.

c Save the changes.

5 Click Build Assembly.

Note: The IDO extension class contains the logic required to save the information to the extension table.

Updating the IDO Assembly information To update the information:

1 Access the ICLabelPrintExtensions IDO

2 Update this information:

• IDO Assembly Name as InsertIntoLabelExtensionTable. • Ext Class Name as InsertIntoLabelExtensionTable. • Ext Class Namespace as InsertIntoLabelExtensionTable.

Page 28: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

28 | Infor Factory Track CSI Extensibility Guide Guide

3 Save the changes.

Creating a new IDO Method To create a new IDO Method:

1 Click New Method.

2 Set Method Type to HandCoded – Standard OR Extension Class - Standard Method.

3 Set Method Name to AddLabelDetails (Manually specify the Function Name).

4 Click OK.

5 Click Methods on IDO.

6 Add the following parameters listed in the table:

Parameter Name Sequence User Data Type Data Type Length/Prec. Input Parameter

LabelRequestId 1 Variant VARCHAR 50 Checked

LabelRequestSeq 2 Variant VARCHAR 50 Checked

7 Save the changes.

Creating IdoPostEvent To create the event handler and the associated code, perform these steps:

1 Access the Events form and select the IdoPostInvoke event name.

Page 29: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 29

2 Create a new Event Handler for the IdoPostInvoke application event.

3 Click Event Handler for the IdoPostInvoke event. The Event Handler (linked) form for IdoPostInvoke event is displayed.

4 Create a new Event Handler.

5 Specify this information in the new Event Handler:

• Applies To Objects as ICLabelPrintDtls.

• Handler Description as Insert Into label extension table.

6 Save the changes.

Page 30: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

30 | Infor Factory Track CSI Extensibility Guide Guide

Creating an Event Action

To create an Event Action:

1 Click Event Actions.

2 Create a new Event Action.

3 Specify this information in a new Event Action:

a Action Sequence as 10

b Action Type as Finish

c Action Description as If not listed method, Finish.

d Parameters as CONDITION (METHOD () <> "ICInsertLabelPrintDetailsSp")

AND METHOD() <> "ICInsertLabelPrintDetailsForPOSp" AND METHOD() <> "ICInsertLabelPrintDetailsForReprintSp" AND METHOD() <> "ICInsertLabelPrintDetailsSp" AND METHOD() <> "ICInsertLabelPrintUtilityDetailsSp")

Note: Click Show Details >> to review the parameters field

e Click Check Syntax and verify no errors are displayed.

f Save the changes.

Page 31: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 31

This instruction terminates the event processing if the method being processed is not one of the listed Methods.

Note: Factory Track programs use the listed methods to insert data into Label Print Tables. This instruction is to ensure the logic is only executed for these methods.

4 Create a new Event Action and specify this information:

a Action Sequence as 20

b Action Type as Load IDO Row

c Action Description as Load Print Record Information

d Parameters as IDO("ICLabelPrintDtls") PROPERTIES("LabelRequestId, LabelRequestSeq, TransName, RecordDate") FILTER(SUBSTITUTE("CreatedBy= '{0}'", ORIGINATOR())) ORDERBY("RecordDate DESC") SET(RV(VLabelReqID) = "LabelRequestId", RV(VLabelReqSeq) = "LabelRequestSeq", RV(VTransName) = "TransName")

Note: May need to click on “Show Details >>” button to see Parameters field.

e Click Check Syntax and verify no errors.

f Save the changes.

Page 32: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

32 | Infor Factory Track CSI Extensibility Guide Guide

5 Create a new Event Action and specify this information:

a Action Sequence as 30

b Action Type as Branch

c Action Description as If no row data found, Finish

d Parameters as

CONDITION(FV(VLabelReqID) = "" OR FV(VLabelReqSeq) = "" OR FV(VTransName) = "") DEST(90)

Note: May need to click on “Show Details >>” button to see Parameters field.

e Click Check Syntax and verify no errors.

f Save the changes.

6 Create a new Event Action and specify this information:

a Action Sequence as 40

b Action Type as Branch

c Action Description as If transaction name = stockmove goto 60

Page 33: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 33

d Parameters as

CONDITION(V(VTransName) = "StockMove") DEST(60)

Note: May need to click on “Show Details >>” button to see Parameters field.

e Click Check Syntax and verify no errors.

f Save the changes.

7 Create a new Event Action and specify this information:

a Action Sequence as 50

b Action Type as Branch

c Action Description as If transaction name = PoReceipt goto 80

d Parameters as

CONDITION(V(VTransName) = "PoReceipt") DEST(80)

Note: May need to click on “Show Details >>” button to see Parameters field.

e Click Check Syntax and verify no errors.

f Save the changes.

Page 34: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

34 | Infor Factory Track CSI Extensibility Guide Guide

8 Create a new Event Action and specify this information:

a Action Sequence as 60

b Action Type as Call IDO Method

c Action Description as Process Stock Move

d Parameters as

IDO("LabelPrintExample") METHOD("AddLabelDetails") PARMS(V(VLabelReqID), V(VLabelReqSeq))

Note: May need to click on “Show Details >>” button to see Parameters field

e Click Check Syntax and verify no errors

f Save the changes.

9 Create a new Event Action and specify this information:

a Action Sequence as 70

b Action Type as Finish

c Action Description as Finish Stock Move Processing

Page 35: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 35

d Save the changes.

10 Create a new Event Action and specify this information:

a Action Sequence as 80

b Action Type as Call IDO Method

c Action Description as Process PO Receipts

d Parameters as

IDO("LabelPrintExample") METHOD("AddLabelDetails") PARMS(V(VLabelReqID), V(VLabelReqSeq))

Note: May need to click on “Show Details >>” button to see Parameters field

e Click Check Syntax and verify no errors.

f Save the changes.

11 Create a new Event Action and specify this information:

a Action Sequence as 90

b Action Type as Finish

Page 36: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

36 | Infor Factory Track CSI Extensibility Guide Guide

c Action Description as Finish PO Receipt Processing

d Save the changes.

Testing Extensions To test the customization:

1 Enable Label printing for the Stock Move transaction.

2 Access the Stock Move form.

3 Perform a Stock Move transaction, using Item 908.

4 Access the Label Print Extensions form. Ensure that the Item Lead Time field and the Unit Weight field are available with the correct information from CSI Item 908, as displayed.

Page 37: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 37

When a label is printed, ensure that the additional information such as Item Lead Time and Unit Weight, are a part of label print file for Bartender print service, as displayed.

Page 38: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

38 | Infor Factory Track CSI Extensibility Guide Guide

Page 39: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 39

Chapter 5 Extensions using new Factory Track 7 architecture without reviews

This section describes the changes to extensions using a new architecture without SQL reviews.

Overview: CSI SQL Views Factory Track uses SQL views to validate and retrieve the data from CSI, for releases before FT 7.0.

To generate SQL Views:

1 Link the Factory Track and the CSI SQL databases, using Linked Server concept of SQL Server.

2 Generate reviews on Factory for CSI tables, using the Site Parameters form.

Note: In Factory Track 7.0, use of SQL Views with CSI Views is not required for the standard product and is not supported in the Cloud deployment environment. This functionality is optionally available for the On-premises deployment environment.

In Collection Validator The Item Validator in the Item Inquiry transaction is attached to a component class of the item which uses the In Collection validation.

Example Factory Track IDO ICSLItems is the IDO collection name that is inherited from CSI IDO SLItems. Prior to version FT7, FT IDO ICSLItems uses SQL reviews for communication with CSI. As a part of FT7, the FT IDO ICSLItems uses Mongoose IDO technology for the new architecture to communicate with CSI.

Page 40: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

40 | Infor Factory Track CSI Extensibility Guide Guide

To communicate with CSI IDO using the new architecture, perform these steps:

1 Update the IDO Assembly information.

2 Add to Factory Track Web Service connector form.

Factory Track

ICSLItems IDO

Factory Track Form

FTSLERPLayer IDO Custom Assembly Extension Class

Web Service connector

validator

CloudSuite Industrial

SLItems IDO

IDO Communication

Page 41: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 41

Updating the IDO Assembly information You must specify this information on the IDO form:

• IDO Assembly name as FTSLERPLayer • Ext Class Name as SLERPDefault • Ext Class Namespace as SLERPLayer

Note: The FTSLERPLayer Extension class project manages the communication between FT and CSI. The standard Factory Track IDO has been updated to make these changes and the custom IDOs must be manually updated with these values.

Adding IDO to the Factory Track web service connector form Most of the Factory Track IDOs are prepended to the CSI IDO name with additional characters (IC). For example, for CSI IDO SLItems, the Factory Track IDO name is ICSLItems.

This rule is not always applicable. In some cases, an entry is added in the Web Service connector form for proper communication.

The CSI communication layer uses the values defaulted in these fields to find the matching CSI IDO invoked for FT IDO. Add these values to the Factory Track Web Service connector form:

• ERP Type: Infor CloudSuite Industrial • IDO Name refers to Factory Track IDO Name • Connector refers to CSI IDO Name

Page 42: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

42 | Infor Factory Track CSI Extensibility Guide Guide

Note: If the values in these fields are not specified, the General IDO naming rule is used.

Utilizing the existing CSI IDO Method in the Factory Track forms This section describes the process to invoke an existing CSI IDO method in the Factory Track form. The CSI IDO name and the CSI IDO method signature are required to execute this process.

Example Create or update the FT IDO to invoke a new or an existing CSI IDO method in the FT form.

Page 43: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 43

Note: Mongoose appends the Access As value at the beginning of Table names, IDO names, Assembly names, and so on. Verify the name of an item after saving to ensure it is correctly used for the remaining steps.

To create or update IDO:

1 Create a new Extension Class assembly. For more information, see:

Note:

• Appendix A which explains the process of creating new Extension Class assemblies in Mongoose.

• The IDO Development Guide for information about creating Extension Class Projects.

2 Use the following API call from CSI communication for the Extension Class code:

a To invoke CSI Standard Method – use ExecuteERPUpdateRequest method and pass

• CSI IDO name • CSI IDO Method name • Output “error” • Comma separated inputs for CSI IDO Method

b To invoke CSI Custom Load Method – use ExecuteERPQueryRequest method and pass

• CSI IDO name • CSI IDO Method name

Factory Track

FT CSI Extension IDO

Factory Track Form

IDO Custom Assembly Extension Class

IDO Method IDO Method Call

CloudSuite Industrial

CSI IDO

Existing IDO Method

IDO Communication

Page 44: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

44 | Infor Factory Track CSI Extensibility Guide Guide

• Output “error” • Comma separated inputs for CSI IDO Method.

3 Create a new IDO name or reuse the existing Extension IDOs. For example, ExtCSIQueries is the Extension CSI Queries IDO.

4 Update the IDO with IDO assembly information related to the newly created extension class.

5 Create a new IDO Method.

6 Set Method Type to Extension Class - Standard Method OR Extension Class - Custom Load Method.

7 Set Method Parameters same as the existing CSI IDO Method signature.

After updating the IDO, the new FT IDO method can be used on the Factory Track forms. When Factory Track forms trigger the FT IDO method, the application calls the CSI IDO Method with the Extension class, internally and returns the data to the Factory Track form.

Combining Data from CSI and FT This example is provided to show combining of the CSI and FT data prior to displaying the Factory Track forms.

Overview: Combining data without views The process of developing the existing FT stored procedures without using CSI views since views cannot be utilized in the cloud environment.

Page 45: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 45

Example When a job is started on the Labor Reporting transaction screen, the start time of the job is recorded only in FT.

To review the list of jobs a user can work on, a query is provided on CSI for all open jobs. These open jobs are evaluated to eliminate the job that is started in FT which results in the final open jobs list.

The query has been managed in FT using a custom load stored procedure. The stored procedure with the help of CSI views, uses an SQL join query to combine the CSI JobTran view and FT punch table to receive the list of open jobs.

For example, the FT CLM_ICSLPopulateSROLineDropDownSp stored procedure contains information combining the CSI view and FT table.

Page 46: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

46 | Infor Factory Track CSI Extensibility Guide Guide

In this example, slfs_sro_line is a CSI view and wm_punch_dtl is a Factory track table.

To combine the data, perform these steps:

1 Create a new CSI IDO method.

2 Creating FT IDO Extension Class Method.

3 Creating a new IDO Method on Factory Track.

Note: Mongoose appends the Access As value at the beginning of Table names, IDO names, Assembly names, and so on. Verify the name of an item after saving to ensure it is correctly used in each step.

Creating a new CSI IDO Method Create a new IDO method in CSI which returns CSI job data from the fs_sro_line table. IDO method on CSI is developed as an Extension class - Custom load method OR a Stored procedure - Custom load method.

Factory Track

FT IDO

Factory Track Form

IDO Custom Assembly Extension Class

IDO Method IDO Method Call

CloudSuite Industrial

CSI IDO

IDO Method IDO Communication

SQL Table (fs_sro_line)

Page 47: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 47

Creating FT IDO Extension Class Method To create the FT IDO Extension Class method:

1 Use the ExecuteERPQueryRequest table to invoke CSI IDO method that has been created.

2 Use ExecuteFTCustomLoadQueryRequest table to combine data with FT. This must be programmed as an Extension Class.

Note: If using on-prem deployment environment, the method can be programmed as a stored procedure.

Example code: public DataTable CLM_FTSLPopulateSROLineDropDown(string CallForm, string EmpNum, string SroNum) {

string error = ""; SetErpErrorMessage(error);

//Step 1 – call CSI Method DataTable table = ExecuteERPQueryRequest("FTSLQueries", "CLM_FTSLPopulateSROLineDropDownSp", out error, CallForm, SroNum); //Call CloudSuite Industrial Method

// The data from CSI is converted into XML to be passed to stored procedure. StringBuilder builder = new StringBuilder(); StringWriter writer = new StringWriter(builder); table.WriteXml(writer); Console.WriteLine(builder.ToString());

//Step 2 – call FT Method and pass in the data from CSI. // Stored Procedure parses XML and use it for logical processing. table = ExecuteFTCustomLoadQueryRequest("FTSLQueries", "CLM_FTSLPopulateSROLineDropDownSp", out error, CallForm, EmpNum, SroNum, builder.ToString()); //Call FT method return table;

}

Creating a new IDO Method on Factory Track To create a new IDO method:

1 Set Method type to Extension class - Standard Method OR Extension class - Custom Method based on the requirement.

2 Update the FT forms to invoke a new IDO method for retrieving data. The new IDO method replaces the previous IDO method which has been called by the Factory Track stored procedure.

Page 48: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

48 | Infor Factory Track CSI Extensibility Guide Guide

Handling the SQL keywords and operators In Factory Track, the Mongoose framework restricts the usage of some SQL keywords and operators on FT IDO, Collection validators, and Extension Classes for the data retrieved from CSI.

For example, these are some of the restricted SQL keywords and operators:

“+”, “-“, ”*”, ”/”, ”>”, ”<”, ”In”, ”Ltrim”, ”Rtrim”, “Not”, ”getDate()”, “Case” , “IsNull”, ”ABS”, “MAX”, subquery(select keyword), any function name in filter condition.

If the functionality requires to use one of the SQL keywords, a new derived property requires to be added on the CSI IDO level that can be queried from FT. These conditions are executed at the CSI IDO level and the results are returned to FT.

This image displays a CSI IDO property, using the SQL keywords:

Page 49: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 49

Chapter 6 Extending the existing stored procedure

Overview: Creating an extended stored procedure In the database, most of the stored procedures have a check embedded in the code to identify an extension to the stored procedure, named extgen_baseProcedureName, where baseProcedureName is the name of the stored procedure being extended. If existing, this stored procedure extension is called when the stored procedure is invoked.

In the system, there is a protected table that contains a selected list of stored procedure which has the extgen_ capability. System users cannot modify this protected table. This table provides a list of stored procedures that can be extended, using the Edit Stored Procedure form.

The primary purpose of the protected table and the Edit Stored Procedure form is to allow developers working in a cloud environment to create some of these extgen_ stored procedures. For example, modifying the data added to the reports.

This process of creating an extended stored procedure is designed primarily for use in a cloud environment, therefore special security measures apply to the extended stored procedures. However, the developers cannot perform these tasks:

• Alter the table that contains the list of valid extendable stored procedures. • Create anything other than an extgen_ stored procedure. • Create an extgen_ stored procedure to any stored procedure other than those included in the

designated table. • Embed calls to dynamic SQL in the procedure code. • Include calls to databases outside the current database in the procedure code.

Example Extend an existing stored procedure, using the Edit Stored Procedure form.

Page 50: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

50 | Infor Factory Track CSI Extensibility Guide Guide

Creating an extended stored procedure To create an extended stored procedure:

1 Access the Edit Stored Procedure form.

2 Select the base stored procedure from the list that is to be extended.

3 Click Copy Procedure to copy the base stored procedure in the work space on the form.

Note: To remove a code in the base stored procedure which may exist before the code that calls the extgen_ stored procedure, select the Remove To Extgen option before copying the procedure.

4 Specify a new code or modify the existing code in the editable text work space.

Note: The stored procedure extension code must begin with a CREATE PROCEDURE statement.

5 Click Submit.

Factory Track

FT Stored Procedure

EXTGEN_ Stored Procedure

Edit Stored Procedure

Form

Page 51: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 51

Chapter 7 Moving the existing Extensions using the Mongoose tools

Importing and exporting IDOs, IDO Extension Classes, and Property Classes Infor Mongoose provides the ability to move IDOs, IDO Extension Classes, and Property Classes from one object’s database to another, using the Mongoose IDO Export Wizard and IDO Import Wizard.

Refer to https://mongoose.infor.com for the details regarding the process.

The Exporting and Importing section describe the procedure for importing and exporting IDOs, IDO Extension Classes, and Property Classes.

Page 52: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

52 | Infor Factory Track CSI Extensibility Guide Guide

FormSync Utility A utility used with a deployed WinStudio application that has been customized. When a site is upgraded to a new version of a WinStudio application, FormSync can be used to retain and upgrade extensions made in the previous version of the application. FormSync can also be used to copy customized objects from one form’s database to another. FormSync works only with customized client-tier objects (user, group, or site versions of forms and global objects) in the WinStudio form’s database and does not affect the application database, the templates database, the objects database, or middle-tier code. Most of the FormSync operations can also be performed, using the FormSync form in Factory Track.

Refer to https://mongoose.infor.com for the details regarding the process.

The Form Synchronization section describes the procedure for importing and exporting IDOs, IDO Extension Classes, and Property Classes.

Page 53: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 53

Appendix A Creating new Extension Class assemblies in Mongoose

A new extension class is created in Mongoose.

References are: System.dll, System.Linq.dll, System.Core.dll, System.Transactions.dll, System.Net.dll, System.Web.dll, System.Net.Http.dll, Newtonsoft.Json.dll

To create a new Extension Class assembly:

1 Create a new Custom Assembly named RS7335CSharp on the IDO Extension Class Assemblies form.

2 Save and click Source Code.

3 Add a new WeatherService source file using the following code:

using System; using System.Net.Http; using System.Web; using Mongoose.Core.Common; using Mongoose.IDO; using Mongoose.IDO.Protocol;

Page 54: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

54 | Infor Factory Track CSI Extensibility Guide Guide

using Mongoose.IDO.DataAccess; using Newtonsoft.Json; namespace RS7335CSharp { public class Coordinates { [JsonProperty( "lat" )] public decimal latitude; [JsonProperty( "lon" )] public decimal longitude; } public class Weather { public string main; public string description; } public class Stats { [JsonProperty( "temp" )] public decimal Temperature; [JsonProperty( "pressure" )] public decimal Pressure; [JsonProperty( "humidity" )] public int Humidity; // public decimal TemperatureF => 32.0M + ((9.0M / 5.0M) * (this.TemperatureK - 273.15M)); } public class WeatherResponse { [JsonProperty( "coord" )] public Coordinates Coordinates; [JsonProperty( "weather" )] public Weather[] Weather; [JsonProperty( "main" )] public Stats Stats; [JsonProperty( "name" )] public string Location; } public static class WeatherService { public static WeatherResponse GetWeather( string name, bool isCity = true ) { var response = default( WeatherResponse ); using ( var client = new HttpClient() ) { // Call asynchronous network methods in a try/catch block to handle exceptions try { string url; if ( isCity ) url = CreateWeatherURL( name ); else url = CreateWeatherURLByZip( name ); var json = client.GetStringAsync( CreateWeatherURL( name ) ) .GetAwaiter() .GetResult(); IDORuntime.LogUserMessage( "WeatherService", UserDefinedMessageType.UserDefined0,

Page 55: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 55

json ); response = JsonConvert.DeserializeObject<WeatherResponse>( json ); IDORuntime.LogUserMessage( "WeatherService", UserDefinedMessageType.UserDefined0, "Deserialize OK" ); } catch ( Exception e ) { IDORuntime.LogUserMessage( "WeatherService", UserDefinedMessageType.UserDefined1, $"Exception: {e.Message}" ); response = new WeatherResponse() { Weather = new Weather[] { new Weather() { main = "unavailable" } } }; } } return response; } private static string CreateWeatherURL( string city ) { var place = string.Format( "{0},us", HttpUtility.UrlEncode( city ) ); return string.Format( "http://api.openweathermap.org/data/2.5/weather?q={0}&appid=3835eee0d7bfd66c357fc4e1ad564d9e&units=imperial", place ); } private static string CreateWeatherURLByZip( string zip ) { return string.Format( "http://api.openweathermap.org/data/2.5/weather?zip={0}&appid=3835eee0d7bfd66c357fc4e1ad564d9e&units=imperial", zip ); } } }

4 Add another MyWeather source file using the following code:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Transactions; using Mongoose.Core.Common; using Mongoose.Core.DataAccess; using Mongoose.IDO; using Mongoose.IDO.Protocol; namespace RS7335CSharp { [IDOExtensionClass( "MyWeather" )] public class MyWeather : IDOExtensionClass { // Add methods and event handlers here // Event handlers should be added using attributes. For example:

Page 56: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

56 | Infor Factory Track CSI Extensibility Guide Guide

// [IDOAddEventHandler( IDOEvent.PreItemDelete )] // private void OnPreItemDelete( object sender, IDOItemUpdateEventArgs args ) // { // } [IDOAddEventHandler( IDOEvent.PostLoadCollection )] private void OnPostLoadCollection( object sender, IDOEventArgs args ) { var response = args.ResponsePayload as LoadCollectionResponseData; var cityIx = response.PropertyList.IndexOf( "City" ); var tempIx = response.PropertyList.IndexOf( "Temperature" ); var conditionsIx = response.PropertyList.IndexOf( "Conditions" ); var humidityIx = response.PropertyList.IndexOf( "Humidity" ); for ( var curIx = 0; curIx < response.Items.Count; curIx++ ) { if ( cityIx != -1 ) { var city = response[ curIx, cityIx ].Value; var weather = WeatherService.GetWeather( city ); if ( tempIx != -1 ) response[ curIx, tempIx ].SetValue( weather?.Stats?.Temperature ); if ( conditionsIx != -1 ) response[ curIx, conditionsIx ].SetValue( weather.Weather?.FirstOrDefault()?.main ); if ( humidityIx != -1 ) response[ curIx, humidityIx ].SetValue( weather?.Stats?.Humidity ); } } } } }

5 Save the source code and return to the IDO Extension Class Assemblies form.

6 Click Build Assembly. You must receive a success message.

7 Create a new MGWeather table/IDO/form. Update this information:

• Primary key as State, City. • IDO Assembly Name as RS7335CSharp. • Class Name as MyWeather. • Namespace as RS7335CSharp.

Page 57: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 57

8 Add rows with name of the cities to the MGWeather form and save the changes.

9 Add a new RS7335VB IDO extension class assembly.

Page 58: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

58 | Infor Factory Track CSI Extensibility Guide Guide

References: RS7335CSharp, System.dll, System.Linq.dll, System.Transactions.dll, System.Net.dll, System.Web.dll, System.Net.Http.dll

10 Save and click Source Code.

11 Add the VBTestClass source file using the following code:

Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Text Imports System.Transactions Imports Mongoose.Core.Common Imports Mongoose.Core.DataAccess Imports Mongoose.IDO Imports Mongoose.IDO.Protocol Imports RS7335CSharp Namespace RS7335VB <IDOExtensionClass( "VBTestClass" )> Public Class VBTestClass : Inherits MyWeather Public Function GetTemperatureByZip( ByVal zip as String, ByRef temperature as Decimal ) As Integer Dim result = WeatherService.GetWeather( zip ) temperature = result.Stats.Temperature Return 0 End Function End Class End Namespace

12 Save and return to the IDO Extension Class Assemblies form and build the assembly.

Page 59: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

Infor Factory Track CSI Extensibility Guide Guide | 59

13 Create a new MGWeatherVB IDO that extends the MGWeather form.

14 Add a new method.

15 Create a new MGWeatherVB form based on the IDO created.

16 Add a ZipEdit edit component.

17 Add the Get By Zip option.

Page 60: Infor Factory Track CSI Extensibility Guide

Creating new Extension Class assemblies in Mongoose

60 | Infor Factory Track CSI Extensibility Guide Guide

18 Add a primary event for the Get By Zip option named GetByZip.

19 Add event handlers.

20 Run the MGWeatherVB form and specify a valid zip code and click Get By Zip. A message

indicating the temperature must be displayed.

Page 61: Infor Factory Track CSI Extensibility Guide

AddTrackingNumber.cs

Infor Factory Track CSI Extensibility Guide Guide | 61

Appendix B AddTrackingNumber.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mongoose.IDO; using Mongoose.IDO.Protocol; using System.Data; namespace AddTrackingNumber { [IDOExtensionClass("ue_SLShipmentTracking")] class AddTrackingNumberUpdate : ExtensionClassBase { /// <summary> /// Set context for base and calling the preloadcollection event for current ido. /// </summary> /// <param name="context">current ido context</param> public override void SetContext(IIDOExtensionClassContext context) { base.SetContext(context); } public AddTrackingNumberUpdate() { try { if (this.Context != null) { SetContext(this.Context); } } catch (Exception) { } } [IDOMethod(MethodFlags.None, "Infobar")] public int AddTrackingNumber(string CoNum, string CoLine, string TrackNum) { int returnvalue = 0; try { UpdateCollectionRequestData request = new UpdateCollectionRequestData(); UpdateCollectionResponseData response; IDOUpdateItem customerItem = new IDOUpdateItem(); //NOTE: Change name of IDO if "Access As" was appended to your IDO name request.IDOName = "SLShipmentTracking"; request.RefreshAfterUpdate = true; customerItem.Action = UpdateAction.Insert; customerItem.Properties.Add("co_num", CoNum); customerItem.Properties.Add("co_line", Convert.ToInt32(CoLine)); customerItem.Properties.Add("Datetime", DateTime.Now);

Page 62: Infor Factory Track CSI Extensibility Guide

AddTrackingNumber.cs

62 | Infor Factory Track CSI Extensibility Guide Guide

customerItem.Properties.Add("track_num", TrackNum); request.Items.Add(customerItem); response = this.Context.Commands.UpdateCollection(request); } catch (Exception ex) { returnvalue = 16; } return returnvalue; } }

}

Page 63: Infor Factory Track CSI Extensibility Guide

ICTrackUpdate.cs

Infor Factory Track CSI Extensibility Guide Guide | 63

Appendix C ICTrackUpdate.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data; using ICERPLayer; namespace ICTrackUpdate { public class ERPTrackUpdate : ICERPLayer.ErpInteractionBase { public int AddTransNum(string CoNum, string CoLine, string TransNum) { string error = ""; int returnvalue = 32; //NOTE: Change name of IDO {ue_SLShipmentTracking} if "Access As" was appended to your IDO name DataTable table = this.ExecuteERPUpdateRequest("ue_SLShipmentTracking", "AddTrackingNumber", out error, CoNum, CoLine, TransNum); //returnvalue = table.Rows.Count; if (table.Rows.Count > 0) { TransNum = table.Rows[0]["TrackNum"].ToString(); try { returnvalue = Convert.ToInt16(table.Rows[0]["ReturnValue"].ToString()); if (returnvalue != 0) { returnvalue = 16; } } catch (Exception) { } } return returnvalue; } } }

Page 64: Infor Factory Track CSI Extensibility Guide

InsertIntoLabelExtensionTable.cs

64 | Infor Factory Track CSI Extensibility Guide Guide

Appendix D InsertIntoLabelExtensionTable.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mongoose.IDO; using Mongoose.IDO.Protocol; namespace InsertIntoLabelExtensionTable { [IDOExtensionClass("InsertIntoLabelExtensionTable")] class InsertIntoLabelExtensionTable : ExtensionClassBase { /// <summary> /// Set context for base and calling the preloadcollection event for current ido. /// </summary> /// <param name="context">current ido context</param> public override void SetContext(IIDOExtensionClassContext context) { base.SetContext(context); } public InsertIntoLabelExtensionTable() { try { if (this.Context != null) { SetContext(this.Context); } } catch (Exception) { } } [IDOMethod(MethodFlags.None, "Infobar")] public int AddLabelDetails(string LabelRequestId, string LabelRequestSeq) { int returnvalue = 0; try { string Item; string ItemLeadTime = string.Empty; string UnitWeight = string.Empty; string strfilter = "LabelRequestId='" + LabelRequestId + "' AND LabelRequestSeq = '" + LabelRequestSeq + "'"; //Retreive Item ID LoadCollectionResponseData ItemResponse = this.Context.Commands.LoadCollection("ICLabelPrintDtls",

Page 65: Infor Factory Track CSI Extensibility Guide

InsertIntoLabelExtensionTable.cs

Infor Factory Track CSI Extensibility Guide Guide | 65

"Item", strfilter, "Item", 1); if (ItemResponse.Items.Count == 1) { Item = ItemResponse[0, "Item"].ToString(); //Retreive ItemLeadTime and UnitWeight strfilter = "Item='" + Item + "'"; LoadCollectionResponseData ItemDetailsResponse = this.Context.Commands.LoadCollection("ICSLItems", "LeadTime,UnitWeight", strfilter, "CreateDate", 1); if (ItemDetailsResponse.Items.Count == 1) { ItemLeadTime = ItemDetailsResponse[0, "LeadTime"].ToString(); UnitWeight = ItemDetailsResponse[0, "UnitWeight"].ToString(); } else { returnvalue = 16; return returnvalue; } } else { returnvalue = 16; return returnvalue; } //insert into ic_label_print_extension table UpdateCollectionRequestData request = new UpdateCollectionRequestData("ICLabelPrintExtensions"); request.RefreshAfterUpdate = true; //Add Item Lead Time IDOUpdateItem customItemLeadTime = new IDOUpdateItem(UpdateAction.Insert); customItemLeadTime.ItemNumber = 1; customItemLeadTime.Properties.Add("LabelRequestId", LabelRequestId); customItemLeadTime.Properties.Add("LabelRequestSeq", LabelRequestSeq); customItemLeadTime.Properties.Add("LabelRequestSubSeq", "1"); customItemLeadTime.Properties.Add("FieldName", "Item Lead Time"); customItemLeadTime.Properties.Add("FieldValue", ItemLeadTime); request.Items.Add(customItemLeadTime); //Add Item Unit Weight IDOUpdateItem customUnitWeight = new IDOUpdateItem(UpdateAction.Insert); customUnitWeight.ItemNumber = 2; customUnitWeight.Properties.Add("LabelRequestId", LabelRequestId); customUnitWeight.Properties.Add("LabelRequestSeq", LabelRequestSeq); customUnitWeight.Properties.Add("LabelRequestSubSeq", "2"); customUnitWeight.Properties.Add("FieldName", "Item Unit Weight"); customUnitWeight.Properties.Add("FieldValue", UnitWeight); request.Items.Add(customUnitWeight); this.Context.Commands.UpdateCollection(request); } catch (Exception) { returnvalue = 16; } return returnvalue; } } }