Good morning,
We're planning to upgrade to Dynamics CU13 and something weird is occuring when we're trying to print WHS documentrouting labels. Since the upgrade the variables used in our documentrouting setup aren't converted to the values.
Example:
I tried deleting all user data of these users through the client and through the AOT and even deleted the UAC files, but that didn't solve my problem.
The only solution I found is deleting the users and importing them again, then the process works. But that seems a little excessive ain't it?
Hopefully someone can help.
Yours,
Berthil
*This post is locked for comments
I just went through the debugger and just realised that our users are in a different language that I am. When changing the language to 'en-us' the labels come out fine.
Went researching further and it seems our business partner forgot to add 6 translations in the Extended Data Types that are used in the WHSLicensePlateLabel table. Since the first fieldLabel is empty, the code doesn't translate the remaining labels.
Dear Chrispin,
The same code is sent to the printer so it also prints the variables on my TEST zebra printer.
This is the code AX uses for a reprint:
void clicked() { WHSLicensePlateLabel whsLicensePlateLabel; WHSDocumentRouting documentRouting = new WHSDocumentRouting(); WHSContainerShipLabel WHSContainerShipLabel; select whsLicensePlateLabel where whsLicensePlateLabel.ContainerId == WHSContainerTable.ContainerId; if (!whsLicensePlateLabel) { WHSContainerShipLabel = new WHSContainerShipLabel(WHSContainerTable); whsLicensePlateLabel = WHSLicensePlateLabel::find(WHSContainerShipLabel.buildLicensePlateLabels()); } documentRouting.printDocument(whsLicensePlateLabel.WorkTransType, whsLicensePlateLabel); }
public boolean printDocument(WHSWorkTransType _workTransType, WHSLicensePlateLabel _label) { WHSDocumentRoutingLine routingLine; RefRecId routeRecId; boolean ret; str finalStr; routeRecId = this.getRoute(_workTransType, _label); while select LayoutId, PrinterName from routingLine where routingLine.DocumentRoutingTable == routeRecId { finalStr = this.translate(WHSDocumentRoutingLayout::find(routingLine.LayoutId).zpl, _label); Microsoft.Dynamics.AX.WHS.DeviceCom.Printer::SendStringToPrinter(routingLine.PrinterName, finalStr); } return ret; }
So finalStr is the ZPL-code that is being built:
str translate(str _inputStr, WHSLicensePlateLabel _label) { TmpSysTableField tmpField; FieldLabel label; str outputStr; outputStr = _inputStr; list.first(tmpField); while (tmpField.FieldLabel != '') { outputStr = strReplace(outputStr, strFmt('$%1$', tmpField.FieldName), strFmt('%1', _label.(tmpField.FieldId))); label = tmpField.FieldLabel; tmpField.clear(); list.next(tmpField); if (label == tmpField.FieldLabel) { break; } } return outputStr; }
Dear Crispin,
Yes, we use this to print to zebra printers. Our partner made a preview dialog so that I can see the label information before it is sent to the printer.
Weird thing is that I suspect it is a usage data issue, but whenever I delete all data from the SysLastValue table and .UAC files the problem still persists.
Yours,
Berthil
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156