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

Notifications

Announcements

No record found.

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 144
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,090 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 266 Super User 2025 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 213 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 140 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans