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)

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)
  • Crispin John Augustine Profile Picture
    37,081 on at

    I don't know of a standard method.

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

  • angelicalaurene Profile Picture
    20 on at

    [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.

  • Verified answer
    Crispin John Augustine Profile Picture
    37,081 on at

    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

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans