Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

different unit of measures based on the vendors in purchase lines

(1) ShareShare
ReportReport
Posted on by 123
Hi everyone!
I hope you are doing well!
Is it possible the UOM (Unit of Measure) is filled automatically based on vendors. I mean, for a particular item, the unit of measure is filled in purchase order based on the vendor.
For example, for item 1, if vendor is A, UOM will be Lit, and if the vendor is B, UOM will be KG.
I tried with item reference, but unfortunately we have to select item reference manually to be filled automatically. 
Also I tested 'Purchase Price' and it does not work also.
Is there any solution out of the box?
Thanks in advance!
 
  • Verified answer
    Ramiz Profile Picture
    Ramiz 461 on at
    different unit of measures based on the vendors in purchase lines
    Hi, 

    You can use Item Reference with customization. There is a field Item Reference Unit of Measure and you can show that.

    Regarding filling it automatically, the system does fill the Item Reference No automatically based on some filters including Item Unit of Mesure but in your case you can subscribe to the event OnAfterFindItemReferenceForPurchaseLine in codeunit Item Reference Management and reset the unit of measure filter. 
     
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Reference Management", OnAfterFindItemReferenceForPurchaseLine, '', false, false)]
        local procedure OnAfterFindItemReferenceForPurchaseLine(var PurchaseLine: Record "Purchase Line"; var ItemReference: Record "Item Reference"; var Found: Boolean)
        begin
            ItemReference.SetRange("Unit of Measure");
            if ItemReference.FindFirst() then
                Found := true;
        end;
     

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans