Bulk Serial and Lot Number Import for Transfer Orders: Excel as a Bridge

In the dynamic environment of Dynamics 365 Business Central, efficient inventory management, especially the bulk import of serial numbers and lot numbers, is crucial for the workflow of transfer orders. Today, we will delve into an effective methodology that simplifies this critical process and paves the way for a broad range of applications, from web service integrations to automation with Power Automate.

We will be using two key tools from Business Central: the “Item Tracking Management” Codeunit for managing item tracking logic, and the “Excel Buffer” Record for handling data import from Excel. This approach will allow us to massively import serials and lots into transfer orders and will also serve as an adaptable foundation for other scenarios requiring complex data processing.

Table of Contents

  1. Scenario
  2. Code
  3. Conclusion

Scenario

Item Tracking Code Configuration

Our example utilizes the “SNALL” tracking code configuration, allowing for serial number tracking both inbound and outbound. Any transfer order for products using this tracking code requires the creation of corresponding item tracking entries to record the movement accurately.

Item Card Configuration

An illustration shows the item tracking code set to “SNALL,” signifying that the item is configured for serial number tracking.

Preparing Item Tracking Entries

Before moving to the Excel template, we prepare an example with serial number data for product 100. This preparation stage is crucial for ensuring that the subsequent Excel processing is based on accurate and relevant data.

Exporting Tracking Template

Navigate through Actions -> Functions -> Serial Template -> Export Tracking Template on the Transfer Order page. This feature exports a simple Excel template, which can be filled with serial numbers based on the quantities specified in the transfer lines. For instance, if a line includes a product with “SNALL” and a quantity of 10, the Excel template will generate 10 rows, one for each serial number. The template also supports variant inclusion if needed.

Filling Out the Template

The next image presents an example of how to fill out the template following the instructions above.

Importing Tracking Template

To import the filled template, go to Actions -> Functions -> Serial Template -> Import Tracking Template on the Transfer Order page.

Reviewing Imported Item Tracking Line

Finally, we showcase how the serial numbers from Excel have been massively imported into the Item Tracking Lines, demonstrating the effectiveness of our solution in streamlining the tracking process.

Code

Part 1: Exporting and Preparing Excel Templates

This set of methods automates the creation of an Excel template for exporting tracking data. It begins by setting up specific headers in the Excel file, followed by processing the transfer orders to fill the template with relevant data, and concludes with saving and closing the file, preparing it for use.

Part 2.1: Importing Data from Excel

This segment of the code handles data importation from an Excel file. It starts with the file upload, continues with inserting data into corresponding transfer lines based on the information read, and uses a specific function to retrieve individual cell values from Excel, facilitating accurate data assignment.

Part 2.2: Creating Tracking Information

This function is crucial to the import process, as it transforms the data extracted from Excel into tracking entries within Business Central. It ensures that each item has the appropriate tracking information (such as serial numbers and lot numbers) based on the specific requirements of each transfer order.

Conclusion

In conclusion, our development for Dynamics 365 Business Central significantly enhances the transfer order process by introducing an efficient method for importing bulk serial and lot numbers directly from Excel. This solution not only saves time and reduces errors but also exemplifies the powerful flexibility of Business Central to adapt to specific inventory management needs. By leveraging the “Item Tracking Management” Codeunit and the “Excel Buffer” Record, we’ve demonstrated a streamlined approach to handling complex data sets, ultimately improving both the accuracy and efficiency of inventory tracking.

We are grateful for your interest in our project. For those eager to explore further, the complete code, along with detailed explanations, is available on our GitHub repository. We encourage your feedback, real-world application, and contributions to continue enhancing the capabilities of Business Central for all users.

Leave a Reply

Your email address will not be published. Required fields are marked *