Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Assigning Variant Codes to Lot Numbers via Configuration Package

(3) ShareShare
ReportReport
Posted on by 212

I have a large number of items, and each item has more than one lot number. I want to assign variant codes to each lot number of every item using a configuration package in Business Central.

Please don’t just give me documentation — instead, guide me step-by-step on:

Which table IDs I need to export/import,

What data I need to include,

And how to do it in a quick and efficient way.

If someone can help me do this properly and quickly, I’d really appreciate it.

  • Suggested answer
    Sohail Ahmed Profile Picture
    3,282 on at
    Assigning Variant Codes to Lot Numbers via Configuration Package
    To assign variant codes to lot numbers using a configuration package in Business Central:
     
    1. Include these tables in your configuration package:
     
    Item (27)
     
    Item Variant (5400)
     
    Item Tracking Lines (5401)
     
     
     
    2. Export the package to Excel.
     
     
    3. In the Item Tracking Lines sheet, map each Lot No. to its corresponding Variant Code for each item.
     
     
    4. Import the updated Excel back and apply the package.
     
     
    5. Verify the variant assignments on lot numbers in BC.
     
     
     
    Make sure lot tracking is enabled and variants already exist for the items.
     
    Mark the checkbox below if this answers your question.
     
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    17,377 Super User 2025 Season 1 on at
  • Suggested answer
    YUN ZHU Profile Picture
    84,274 Super User 2025 Season 1 on at
    Assigning Variant Codes to Lot Numbers via Configuration Package
    If you add Variant Codes as Lot No., the standard can do it. If you need another field to save Variant Codes, the standard cannot do it and you need to add a new field.
    It is recommended to contact your partner to solve
     
    Thanks
    ZHU
  • Suggested answer
    Mansi Soni Profile Picture
    3,391 on at
    Assigning Variant Codes to Lot Numbers via Configuration Package
    Hello,

    In Business Central, assigning variant codes directly to lot numbers is not supported in the standard functionality, as variant codes are associated with items, not with specific lot numbers. Variant codes are managed through table 5401 "Item Variant", which defines all valid combinations of items and variant codes. Lot numbers, on the other hand, are handled through item tracking, using tables like 336 "Tracking Specification", 337 "Reservation Entry", and 6504 "Item Lot No. Information", but none of these contain a field for variant code.

    If you want to associate variant codes with lot numbers for reporting or business logic, a standard configuration would involve defining item variants in table 5401 and then ensuring that during transactions (such as receiving or production), the correct variant code and lot number combination is used. You can then analyze these combinations from historical data using table 32 "Item Ledger Entry", which stores both variant codes and lot numbers related to each transaction.

    However, if you require a direct link between lot numbers and variant codes for each item, this would require customization, such as creating a custom table or extension to map lot numbers to variant codes. This custom setup could then be managed through a configuration package for bulk import and updates.

    Hope this answer will help you!

    Regards,
    Mansi Soni
  • Talha Yaseen Profile Picture
    212 on at
    Assigning Variant Codes to Lot Numbers via Configuration Package

    Hi,
    In Business Central, I want to assign main variant codes to the lot numbers of those items across the main locations. There are more than 1000 such items, and some quantities are already available. I want to assign main variant codes to these lot numbers, which currently do not have any variant code assigned.

    The method you suggested creates the Lot No. Information Cards, but the existing entries made against these items do not reflect or pick up these newly created Lot No. Information Cards. please help me out on this if possible Thanks
    I appreciate you suggestion.

  • Suggested answer
    YUN ZHU Profile Picture
    84,274 Super User 2025 Season 1 on at
    Assigning Variant Codes to Lot Numbers via Configuration Package
    Hi, Mainly the two tables below, you can enter manually on the BC first, and then export to confirm the value.
    table 337 "Reservation Entry" and table 6505 "Lot No. Information"
    PS:
    Dynamics 365 Business Central: How to create Item Tracking Lines automatically during an inbound transaction (Customization)
     
    Hope this helps.
    Thanks.
    ZHU
  • Talha Yaseen Profile Picture
    212 on at
    Assigning Variant Codes to Lot Numbers via Configuration Package
    @Sohail Ahmed
    SORRY but can you please simplify this more i am not understanding 
    Thankis
  • Suggested answer
    Sohail Ahmed Profile Picture
    3,282 on at
    Assigning Variant Codes to Lot Numbers via Configuration Package

    1. Prepare Your Data:

    • Required columns in Excel:

      • Item No. (from table 27 "Item")

      • Lot No. (from table 6505 "Item Ledger Entry")

      • Variant Code (your custom value)

    2. Table IDs to Use:

    • Primary table: 6500 "Item Variant" (creates variant records)

    • Secondary table: 6508 "Item Tracking Code" (links variants to tracking)

    3. Configuration Package Setup:

    1. Search for "Configuration Packages"

    2. Create new package

    3. Add table 6500 (Item Variant)

    4. Include these fields:

      • "Item No."

      • "Code" (your variant code)

      • "Description"

    4. Import Process:

    1. Export template from Configuration Package

    2. Populate your Excel file with:

      • Column A: Item No.

      • Column B: Code (variant code)

      • Column C: Description (optional)

    3. Import back into BC

    Pro Tip for Efficiency:

    • Use Power Query in Excel to combine your item list with lot numbers

    • Process in batches of 500-1000 records at a time

    • Verify first with 5-10 test records

    Post-Import Steps:

    1. Check results in "Item Variants" page

    2. Assign tracking codes to variants in "Item Tracking Codes" page

    If this solution works for you, please mark this answer as verified. For large-scale implementations, consider consulting a Microsoft Partner for automated solutions.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans