BarcodeSetupId barcodeSetupId; BarcodeSetup barcodeSetup; Barcode barcode; BarCodeString encodeBarcode(Str _barcodeValue) { if (barcodeSetup.validateBarcode(_barcodeValue)) { barcode.string(true, _barcodeValue, BarcodeContentType::Item); barcode.encode(); } else { throw(error(strfmt("@SYS41409", barcode.barcodeType(), _barcodeValue))); } return barcode.barcodeStr(); } // Init barcode barcodeSetupId = InventParameters::find().BarcodeSetupIdPick; barcodeSetup = BarcodeSetup::find(barcodeSetupId); barcode = barcodeSetup.barcode(); if(barcodeSetup.BarcodeType != BarcodeType::NoBarcode) { // Check font parameters //barcodeSetup.FontName; //barcodeSetup.FontSize; } encodeBarcode("packing12345"); // encode string to barcode, should be printed at report to display barcodeVariant 2, specific barcode type:
BarcodeCode128 barcode128 = BarcodeCode128::construct(); barcode128.string(true, salesTable.ReturnItemNum); barcode128.encode(); barcode128.barcodeStr(); // returns encoded string of barcode, should be printed at report to display barcode //barcode128.barcodeStrHR(); // returns human readable stringIn SSRS report use relevant font at the control which should display barcode for case above BC C128 should be used.
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units and "buy me a coffee" link.
Join us.