Skip to main content
Solved

Generic Inquiry to pull most recent record

  • January 20, 2025
  • 6 replies
  • 69 views

Greetings,

 

I am trying to work though something, but I am hitting a bit of a wall. This is the request of a client.

 

They have a simple AR tran inquiry but instead of pulling all the records, they only want to pull the most recent ar tran line per customer. It needs to be accurate for that line, so I can’t do any grouping since the values don’t generally fall within the min/max/average solutions.

Best answer by craig2

 Hi ​@shooper10 ,

 

I’m struggling to find the post from I think ​@Gabriel Michaud, but he had a unique solution to a similar scenario.  In your case, pull in a 2nd copy of the ARInvoice table, and name it something like ARInvoiceLAST.  On your Joins, do the following:

 

 And on your Conditions, do this:
 

What you’re basically saying is “find me the invoice for each Customer that is not less than anything,” which is kind of a backwards way of saying the “last” of something.

From there, you can Join in your ARTran table to ARInvoice, and build out as normal.

Hope that helps!

View original
Did this topic help you find an answer to your question?

6 replies

NickCerri4
Jr Varsity II
Forum|alt.badge.img
  • Jr Varsity II
  • 17 replies
  • January 20, 2025

Hey there!  I know you said you can’t do any grouping, but I pulled the Ref Nbr., Customer ID, and Last Modification Date/Time fields from AR Tran into a GI and grouped on Customer ID.  I then created a test Invoice and it looks like it does pull the most recent record.  AR Tran is going to pull all detail lines in, but they won’t be able to edit them after releasing any way.  Let me know if this gets you closer.  What other considerations are there when displaying the data in the GI?

 


  • Author
  • Freshman I
  • 2 replies
  • January 20, 2025
NickCerri4 wrote:

Hey there!  I know you said you can’t do any grouping, but I pulled the Ref Nbr., Customer ID, and Last Modification Date/Time fields from AR Tran into a GI and grouped on Customer ID.  I then created a test Invoice and it looks like it does pull the most recent record.  AR Tran is going to pull all detail lines in, but they won’t be able to edit them after releasing any way.  Let me know if this gets you closer.  What other considerations are there when displaying the data in the GI?

 

I have found it isn’t consistent; the issue is they want the dollar value of the line and a formula they have associated with that line. That is why grouping isn’t an ideal solution. It gets them “most” of the way there but there as it is fixed data, but there are a couple fields that need to be accurate as decisions are made from that.


craig2
Pro I
Forum|alt.badge.img+3
  • Pro I
  • 97 replies
  • Answer
  • January 20, 2025

 Hi ​@shooper10 ,

 

I’m struggling to find the post from I think ​@Gabriel Michaud, but he had a unique solution to a similar scenario.  In your case, pull in a 2nd copy of the ARInvoice table, and name it something like ARInvoiceLAST.  On your Joins, do the following:

 

 And on your Conditions, do this:
 

What you’re basically saying is “find me the invoice for each Customer that is not less than anything,” which is kind of a backwards way of saying the “last” of something.

From there, you can Join in your ARTran table to ARInvoice, and build out as normal.

Hope that helps!


  • Author
  • Freshman I
  • 2 replies
  • January 20, 2025
craig2 wrote:

 Hi ​@shooper10 ,

 

I’m struggling to find the post from I think ​@Gabriel Michaud, but he had a unique solution to a similar scenario.  In your case, pull in a 2nd copy of the ARInvoice table, and name it something like ARInvoiceLAST.  On your Joins, do the following:

 

 And on your Conditions, do this:
 

What you’re basically saying is “find me the invoice for each Customer that is not less than anything,” which is kind of a backwards way of saying the “last” of something.

From there, you can Join in your ARTran table to ARInvoice, and build out as normal.

Hope that helps!

Oh this may have some promise, I will try this out. In my testing, I was getting close to this didn’t come at it in this particular way.


darylbowman
Captain II
Forum|alt.badge.img+13
craig2 wrote:

I’m struggling to find the post from I think ​@Gabriel Michaud, but he had a unique solution to a similar scenario.

How to get the last sales price and qty using GI?

I’ve used it several times 🙂

 


craig2
Pro I
Forum|alt.badge.img+3
  • Pro I
  • 97 replies
  • January 21, 2025

There we go, bookmarked now!  Thanks ​@darylbowman !


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings