Comparing UOM

Savatage
Member Posts: 7,142
What code is it to compare two units of measure?
One Item
Two Units Of Measure (Each & Deal)
Each always 1
Deal Always > 1
I want to pop a message up that says "Both Qty Per Units Of Measure Are The Same" (or something)
I was thinking simply
IF "Code" = 'DL' and "Qty. Per Unit Of Measure" := 1 THEN
ERROR('Wrong QTY Entered!");
But i must be missing some parenthasis or something
If somone types in the wrong info & tries to exit the UOM form when entering a new item.
Code = Code
Qty Per Unit Of Measure = Decimal
I've tried a few codes but it's not working the way I want it to.. I'm looking for a new perspective From Y'all.
Thanks
One Item
Two Units Of Measure (Each & Deal)
Each always 1
Deal Always > 1
I want to pop a message up that says "Both Qty Per Units Of Measure Are The Same" (or something)
I was thinking simply
IF "Code" = 'DL' and "Qty. Per Unit Of Measure" := 1 THEN
ERROR('Wrong QTY Entered!");
But i must be missing some parenthasis or something
If somone types in the wrong info & tries to exit the UOM form when entering a new item.
Code = Code
Qty Per Unit Of Measure = Decimal
I've tried a few codes but it's not working the way I want it to.. I'm looking for a new perspective From Y'all.
Thanks
0
Comments
-
I don't really understand exactly what you want, other than that you want to know how to prevent a user from entering two UOM's with the same 'Qty per UOM'. If that is the case, you should create a new function in the 'Item Unit of Measure' table called 'CheckQtyPer' or something. This function searches for Item Unit of Measure records for the same Item and the same qty per, and raises an error if it finds one. Call this function from the OnInsert as well as the OnModify trigger. You could also add the call to the Qty per UOM field.
The function looks something like this (I have not tested this, so tweak as you go please):locItemUOM, local Record var, subtype "Item Unit of Measure" locItemUOM.RESET; locItemUOM.SETFILTER("Item No.",'=%1',Rec."Item No."); locItemUOM.SETFILTER("Qty. per Unit of Measure",'=%1',Rec."Qty. per Unit of Measure"); IF locItemUOM.FIND('-') THEN BEGIN ERROR('There already is an Item Unit of Measure with Qty. per Unit of Measure ' + FORMAT("Qty. per Unit of Measure")); END;
HTH0 -
that's a great idea - i think these long hours are starting to take a toll! :?
thanks for the suggestion0 -
yeah I hate long hours. Come to think of it, I hate short hours too :whistle:0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions