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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

WHSLicensePlate variables not converted by user

(0) ShareShare
ReportReport
Posted on by 204

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:

ZPL-error.png

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 have the same question (0)
  • Berthil Profile Picture
    204 on at

    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

  • Berthil Profile Picture
    204 on at

    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;
    }


  • Verified answer
    Berthil Profile Picture
    204 on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
GL-01081504-0 Profile Picture

GL-01081504-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans