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

Announcements

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 182
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,266 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 88 Super User 2026 Season 1

#2
Sagar Suman Profile Picture

Sagar Suman 72 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans