0

Imagine you run a hybrid operation—warehousing, retail, and light manufacturing for consumer electronics. Every day, boxes move from inbound docks to assembly cells, then to retail pick faces. Along that path, you create objects that must be tracked: assembly jobs, pick tickets, wave shipments, and return RMAs. In Dynamics 365 Finance & Operations, those IDs aren’t just random numbers; they’re readable, configurable identifiers that operations people can recognize at a glance. That’s where X++ and the platform’s built-in numbering framework come together.

First, what is X++? It’s the object-oriented language that powers business logic in D365FO. If you think in C# or Java terms, you’ll feel at home: classes, inheritance, table methods, and event patterns (plus Chain of Command for upgrade-safe extensions). You write X++ to validate data, orchestrate transactions, and—crucially for operations—assign identifiers the moment a new record is born.

Now, what is an x++ number sequence? In plain terms, it’s the programmable endpoint of the platform’s number sequence engine: admins design formats like WPK-###### with prefixes and zero padding, decide whether numbering should be continuous or allow gaps, and set scope (shared vs. per company). As a developer, you declare a reference that links your business concept—say, a “Warehouse Pick Ticket”—to that configurable sequence. Then, in the right lifecycle moment (insert, initValue, or a form event), you ask the engine for the next number and stamp it onto the record. If you’ve ever watched a picker scan a tote labeled “WPK-004217” and instantly know which wave it belongs to, you’ve seen the value.

Let’s put it in the warehousing–retail–manufacturing electronics context. You want a unique pick ticket ID every time the system groups sales lines for fulfillment. Operations wants it company-scoped, readable in the aisle, and created automatically when the pick ticket record is inserted. Here’s a compact pattern you can drop into your solution.

// 1) Reference loader: declare the sequence "reference" for your EDT
public final class NumberSeqModule_RetailWMS extends NumberSeqApplicationModule
{
    public void loadModule()
    {
        // Company scope (DataArea). Use createDefaultScope() for shared if needed.
        NumberSeqScope      scope = NumberSeqScopeFactory::createDataAreaScope();
        NumberSeqReference  nsRef = NumberSeqReference::construct();

        nsRef.parmDatatypeId(extendedTypeNum(RetailWmsPickTicketId)); // your EDT
        nsRef.parmReferenceLabel(literalStr("Warehouse Pick Ticket ID"));
        nsRef.parmReferenceHelp("Readable ID for retail/manufacturing pick waves");
        nsRef.addParameterType(NumberSeqParameterType::DataArea, true, false);

        this.addRef(nsRef);
    }
}

// 2) Parameters class helper: expose a getter the UI can bind to
public final class RetailWmsParameters extends SysOperationParametersBase
{
    public static NumberSeqReference numRefPickTicket()
    {
        return NumberSeqReference::findReference(extendedTypeNum(RetailWmsPickTicketId));
    }
}

// 3) Table extension: assign the ID at the right lifecycle moment
[ExtensionOf(tableStr(RetailWmsPickTicket))] // your table that repr. a pick ticket
final class RetailWmsPickTicket_Ext
{
    public void insert()
    {
        if (!this.PickTicketId) // field based on EDT RetailWmsPickTicketId
        {
            // Pull the admin-configured sequence selected on your Parameters form
            NumberSeq ns = NumberSeq::newGetNum(RetailWmsParameters::numRefPickTicket());
            this.PickTicketId = ns.num(); // e.g., WPK-000123
        }

        next insert();
    }
}

What’s happening behind the scenes is simple but powerful. Admins pick a format like WPK-###### on your parameters page; your table extension calmly asks the engine for “the next one” during insert; the result is memorable, sortable, and operationally useful on labels, handheld screens, and audit reports. If auditors require no gaps, make the sequence continuous and tune preallocation; if speed under heavy throughput matters more than gap-free IDs, keep it non-continuous and fly.

You’ll hear people say “number sequence in d365fo x++” when they’re talking about this exact pattern: a clean handshake between configurable numbering and the code paths where real business records come to life.

Have a Question ?

Fill out this short form, one of our Experts will contact you soon.

Talk to an Expert Today

Call Now

Call Now800-453-5961