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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to validate if a license plate is already existing and existing in other locations in X++ code?

(0) ShareShare
ReportReport
Posted on by 20

Hi,

What I'm trying to achieve is to validate a license plate ID generated by a user, if it is already existing and existing in other locations. If it is not, I will insert the license plate ID in the WorkTable.

How can I validate this or are there standard methods / code I can follow to validate?

Thank you.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Crispin John Augustine Profile Picture
    37,081 on at
    RE: How to validate if a license plate is already existing and existing in other locations in X++ code?

    Your query is correct, but the assumption is wrong.

    it should be inventSum.AvailPhysical (instead of RecId)  I am sure, you will spot the difference immediately

  • angelicalaurene Profile Picture
    20 on at
    RE: How to validate if a license plate is already existing and existing in other locations in X++ code?

    [quote user=""Crispin"][/quote]

    I don't know of a standard method.

    But a simple code to look at InventSum joined with InventDim should do the job..

    Hi Crispin,

    Thanks for the suggestion!

    I tried doing this:

    inventDim       = InventDim::find(_workLine.InventDimId);
    inventStatusId  = _workLine.inventDim().InventStatusId;
    
    select firstonly RecId from inventSum
    join inventDimLoc
    join inventDim
    where inventDimLoc.inventDimId == inventDim.inventDimId
    && inventDim.inventDimId == inventSum.InventDimId
    && inventDim.InventLocationId == inventDimLoc.InventLocationId
    && inventDim.InventSiteId == inventDimLoc.InventSiteId
    && inventDim.LicensePlateId == targetLicensePlateId
    && inventDim.wmsLocationId == inventDimLoc.wMSLocationId
    && (inventDim.InventStatusId == inventStatusId);
    
    if (inventSum.RecId == 0)
    {
        WHSWorkTable::addTargetLicensePlate(_workLine.WorkId, targetLicensePlateId);
    }

    I checked if the RecId of InventSum is blank or has a value. If it's blank, it means the license plate is not existing yet, but if there is a value, it means it exists.

  • Crispin John Augustine Profile Picture
    37,081 on at
    RE: How to validate if a license plate is already existing and existing in other locations in X++ code?

    I don't know of a standard method.

    But a simple code to look at InventSum joined with InventDim should do the job..

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
KP-31070522-0 Profile Picture

KP-31070522-0 3

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans