
Printing a barcode on the Production Route Card in Dynamics 365 Supply Chain Management (D365 SCM) requires modifying the Route Card SSRS report. Below is a step-by-step guide to achieve this:
The ProdRouteCardDP class is responsible for fetching data for the report. You need to modify it to include a barcode field.
[DataContractAttribute]
public class ProdRouteCardTmp_Extended extends ProdRouteCardTmp
{
private str barcode;
[DataMemberAttribute]
public str parmBarcode(str _barcode = barcode)
{
barcode = _barcode;
return barcode;
}
}
public class ProdRouteCardDP_Extended extends ProdRouteCardDP
{
public override ProdRouteCardTmp getProdRouteCardTmp()
{
ProdRouteCardTmp_Extended prodRouteCardTmp = super();
// Generate Barcode using ItemId or any other field
prodRouteCardTmp.parmBarcode(Barcode::encodeStr2of5(prodRouteCardTmp.ItemId));
return prodRouteCardTmp;
}
}
📌 Key Points:
Barcode::encodeStr2of5() is used to encode the ItemId as a barcode. You can change this to Barcode::encode128() for Code 128.I suggest duplicating the report design, making the necessary modifications on the duplicate, and then applying the required changes to ensure the call functions correctly.
=Fields!Barcode.Value
IDAutomationHC39M (for Code 39)Free 3 of 9 (if using a free font)Code 128 (for Code 128)Instead of modifying the DP class, you can:
="*" & Fields!ItemId.Value & "*"
* before and after the value)