Skip to main content
Answer

How to Show Only Archived Records in a Generic Inquiry with the use of a Parameter?

  • May 20, 2025
  • 5 replies
  • 68 views

Forum|alt.badge.img+1

Whilst the Generic Inquiry definition has a “Show Archived Records” option, this is not as flexible as the “Show Deleted Records” option.

With the Show Deleted Records option you can then use a parameter to include/exclude the display of these records.  This was because there was a field on the records that indicates if the record was deleted.  This is useful. 

With Archived Records, no such field - unless someone can inform me of some magic way of filtering.  A end user cannot be expected to go in and toggle Show Archived Records on and off.   Thus you are left with show only non archived records or show all with no user control when running the GI.  Thus not useful.  For most users they will need to have 2 Generic Inquiries.  One quick GI that does not include Archived Records and another GI that includes Archived records.  Clearly not efficient and confusing for end users.

Solution?  Unless someone can inform me of some magic way of filtering which would be the most efficient approach, there is a solution.  As an example, List of Sales Orders GI.  Include the Option for Show Archived Records.  Create another GI on the Sales Orders but where Show Archived Records is turned off.  Use the 2nd GI as a Datasource for the 1st GI.  The first GI can then test if a record is archived or not.  Problem solved - as long as it works efficiently for when the site has 100,000’s of records.

Since the Report Designed has more options in this area, perhaps there is a field on the SOOrders and SOShipments that indicates if the record is archived.

Best answer by JeffPatch

Update:

Finally worked it out.  The trick is got two parts:
Part 1:  On the GI you need to check both Show Archived Records and Show Deleted Records.
Part 2.  On the SOOrder table, there is a field DatabaseRecordStatus.  Does not display anything if you input the Datafield as DatabaseRecordStatus, but it works if you use =[SOOrder.DatabaseRecordStatus].
Unfortunately I have not worked out how to use the field for record/cell styles.

End Result:  I can filter GI for Archived or not archived records.

I have atatched a sample GI

 

5 replies

Forum|alt.badge.img+1
  • Author
  • Jr Varsity II
  • May 20, 2025

Update on my question above:

FYI: I tested creating a Generic Inquiry where I had the Option to Show Archived Records and linked it to a GI of the same table where I did not have the Show Archived Records as Ticked.  Unfortunately - not successful.  Whilst you can link GI 1 to GI 2, it will not run - errors out.  Untick the Show Archived Records - works.


dcomerford
Captain II
Forum|alt.badge.img+15
  • Captain II
  • May 20, 2025

@jlpatch Like your idea what is the join between the GI’s


  • Freshman III
  • May 20, 2025

The join between the GI’s is simply a left join
    OrderType = SOOrder_orderType

    OrderNbr = SOOrder_orderNbr

This works as long as the Show Archived Records set to False.  Otherwise it errors.


  • Freshman III
  • Answer
  • May 20, 2025

Update:

Finally worked it out.  The trick is got two parts:
Part 1:  On the GI you need to check both Show Archived Records and Show Deleted Records.
Part 2.  On the SOOrder table, there is a field DatabaseRecordStatus.  Does not display anything if you input the Datafield as DatabaseRecordStatus, but it works if you use =[SOOrder.DatabaseRecordStatus].
Unfortunately I have not worked out how to use the field for record/cell styles.

End Result:  I can filter GI for Archived or not archived records.

I have atatched a sample GI

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • May 20, 2025

Thank you for sharing your solution with the community ​@JeffPatch!