AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Create a Generic In...
 
Notifications
Clear all

Questions Create a Generic Inquiry to Show only Orders with Specific Inventory Items

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Charles Craig 2 years ago
13 Posts
5 Users
3 Reactions
1,169 Views
RSS
Brett Clark
Posts: 10
 Brett Clark
Topic starter
September 5, 2023 12:26 pm
(@bclark)
Eminent Member
Joined: 3 years ago

Hello,ย 

I'm trying to create a GI that shows all orders that only have a inventory ID that starts with "6". These items are our Holiday gift boxes.ย 

I don't want any orders to show up where someone orders a gift box plus additional items.ย 

If the order includes multiple gift boxes (60001 and 60002 for example) then it should appear on the list.ย 

If the order includes 60001 and another item 10003, then it should not be included.ย 

Does anyone have any thoughts on how I could get this started?

Thanks!


Topic Tags
Generic Inquiry Help
12 Replies
Charles Craig
Posts: 21
 Charles Craig
September 5, 2023 2:17 pm
(@charles-craig)
Eminent Member
Joined: 4 years ago

This is not what you asked for specifically, but in SQL you could do this:

SELECT * FROM
SOOrder o
LEFT JOIN SOLine l ON (o.id = l.OrderNbr)
WHERE
o.id NOT IN (
    SELECT sub_o.id FROM
    SOOrder sub_o
    LEFT JOIN SOLine sub_l ON (sub_o.id = sub_l.OrderNbr)
    WHERE
    sub_l.InventoryID NOT LIKE '6%'
)

I'm still very new to Acumatica, so I'm not sure if Gi supports sub-queries. I will look into that for my own curiosity unless someone else can chime in.

Also, this could be manually turned into a View in the database so it would possibly become compatible with GI, but I think you'd need a DAC for that... might be a good candidate for a Customization Project. However, I'd love know if there's an easier way too!


Reply
alconroy
Posts: 32
 alconroy
September 5, 2023 3:24 pm
(@alconroy)
Eminent Member
Joined: 4 years ago

Join SOOrder to SOLine and SOLine to InventoryItem

You can then set a condition the InventoryCD starts with 6

ย 

You could also add an attribute to the item called Holiday Boxes and filter the condition based off the attribute.

ย 


Reply
Charles Craig
 Charles Craig
(@charles-craig)
Joined: 4 years ago

Eminent Member
Posts: 21
September 5, 2023 3:29 pm
Reply toalconroyalconroy

@alconroy The tricky part is that he does not want any orders that also contain line items that don't start with 6.

A condition of starting with 6 returns orders that have both gift boxes and non-gift boxes.


Reply
Brett Clark reacted
Brett Clark
 Brett Clark
(@bclark)
Joined: 3 years ago

Eminent Member
Posts: 10
September 5, 2023 4:11 pm
Reply toCharles CraigCharles Craig
alconroy

@charles-craigย 

Exactly, that's where I've been having trouble. This works for showing only line items that start with 6, but it still has order numbers on there that have other items.ย 


Reply
Anne Trockman
Posts: 7
 Anne Trockman
September 5, 2023 4:02 pm
(@anne-r-trockman)
Active Member
Joined: 5 years ago

Instead of setting the condition so that it starts with 6, what about setting a condition so that it excludes items that start with 1-5 (assuming that 6 is the highest start), or excludes 1-5 and 7-9 ... would that do the trick without overthinking?ย 

ย 


Reply
Brett Clark
 Brett Clark
(@bclark)
Joined: 3 years ago

Eminent Member
Posts: 10
September 5, 2023 4:14 pm
Reply toAnne TrockmanAnne Trockman

@anne-r-trockman This issue isn't getting items that start with 6 to show. The trouble is showing items at the Order Level that ONLY include items that start with 6 at the line item level.ย 

I want to show orders where people ONLY bought gift boxes (items that start with 6), so it needs to exclude the orders where someone bought a gift box and something else.ย 


Reply
Charles Craig
 Charles Craig
(@charles-craig)
Joined: 4 years ago

Eminent Member
Posts: 21
September 5, 2023 4:29 pm
Reply toAnne TrockmanAnne Trockman

@anne-r-trockman unfortunately, that still puts us back in the same spot where it returns orders that contain both.

My example only has the Acumatica test data but the same applies if we only want InventoryID's that start with "A".ย 

The issue is that the orders in the red boxes are still being returned even though we, say, excluded "B-Z"

Screen Shot 2023 09 05 at 4.14.55 PM

Reply
RICHARD HEAP
Posts: 6
 RICHARD HEAP
September 5, 2023 7:27 pm
(@richard-heap)
Active Member
Joined: 5 years ago

I sometimes take a two step approach if the outcome is that specific.

Create a column in the results list that checks for the 6 and with the group by at the order level if a non 6 occurs on any line then max returns.ย  ย  =Max(IIf( Left( [InventoryItem.InventoryCD], 1) = '6', 0, 999))

image

ย 

Then just use a filter on the GI output to only show the 0

image

ย 

ย 

image

Reply
Charles Craig
 Charles Craig
(@charles-craig)
Joined: 4 years ago

Eminent Member
Posts: 21
September 5, 2023 9:46 pm
Reply toRICHARD HEAPRICHARD HEAP

@richard-heap I was trying to see if I could avoid filters, but this gets the job done. I wonder about how it scales for larger datasets since this will require a full results scan. Now if we could add a "HAVING" clause to it, then we'd get full performance.ย 


Reply
RICHARD HEAP
Posts: 6
 RICHARD HEAP
September 6, 2023 12:18 am
(@richard-heap)
Active Member
Joined: 5 years ago

Working with the tools they give us.ย  😀ย 


Reply
Charles Craig
 Charles Craig
(@charles-craig)
Joined: 4 years ago

Eminent Member
Posts: 21
September 6, 2023 9:15 am
Reply toRICHARD HEAPRICHARD HEAP

@richard-heap This gives me motivation to build some better tools for it ๐Ÿ™‚


Reply
Tim Rodman reacted
RICHARD HEAP
Posts: 6
 RICHARD HEAP
September 6, 2023 12:21 am
(@richard-heap)
Active Member
Joined: 5 years ago

Perhaps take a different approach and just select orders with the item 6 on it, sum the soline.qty on the lines and compare to the total soorder qty.ย  ย If different then clearly other things on it.....

ย 


Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Related Topics
  • Unable to Add Field "Unapplied Balance" to Generic Inquiry "Payments and Applications"
    6 months ago
  • Equivalent to Excel Post-Special, "transpose"
    1 year ago
  • Generic Inquiry - Last Modified On Date Change
    1 year ago
  • Generic Inquiry, pulling data from two unrelated sources
    1 year ago
  • Adding Override Contact Info to GI Results
    1 year ago
Topic Tags:  Generic Inquiry (41) , Help (3) ,
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 4 Online
  • 2,324 Members
Our newest member: Michael Kiley
Latest Post: Pick List report suddenly not splitting on Shipment
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright ยฉ 2025 ยท AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

โ€นโ€บร—

    โ€นโ€บร—