web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Shorten product number in barcode creation

(1) ShareShare
ReportReport
Posted on by 174
Hi guys,
 
i need to create EAN13 barcodes manually with the following functionality:
 
As you can see in the picture above, the item number has the "-00" at the end. Is it possible to cut that off, while creating the barcode? 
I tried to restrict only 7 digits in the bar code mask set up, hoping it would cut the last digits off.
Sadly i get an error when i tried to create a bar code with that set up. 
Error: "The Product ID is only 7 digit long according to the bar code mask. Enter just the product ID or the full bar code with or without the check digit."
 
When i set the length field of the Product to 11, it works, but the system puts the whole product number in the barcode icluding the "-00". In this case it of course is no EAN13  anymore. I just wanted to test if it works.
 
Does anyone know how i can solve this issue?
 
Thanks in advance
 
Simon
I have the same question (0)
  • Vahid Ghafarpour Profile Picture
    12,258 on at
    I hope this X++ code can help you 
     
    str itemNumber = "1234567-00";
    str trimmedItemNumber = substr(itemNumber, 1, strlen(itemNumber) - 3); // Removes the last 3 characters
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 130 Super User 2026 Season 1

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 92 Super User 2026 Season 1

#3
Zain Mehmood Profile Picture

Zain Mehmood 89 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans