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
Everything Else
What SQL table stor...
 
Notifications
Clear all

Questions What SQL table store Audit History information for Acumatica?

 
Everything Else
Last Post by Henry Marambio 2 years ago
4 Posts
3 Users
1 Reactions
1,761 Views
RSS
Henry Marambio
Posts: 4
 Henry Marambio
Topic starter
September 8, 2023 11:35 am
(@hmarambio)
Active Member
Joined: 3 years ago
  • The answer to this question probably also applies to AUG SQL product
  • I have access to my MS SQL databases.  I am on 2022 R2 but I don't think my question is necessarily version specific

 

I would like to provide a SQL view/ Generic Inquiry of certain information from the AUDIT HISTORY.  This information would be used to identify when certain workflow & process rules are not followed.  Can someone please point me to the SQL tables that store this data?

My plan is to create a SQL view on the SQL server and "publish" it via a customization in order to make it available within Acumatica.

I'll be happy to share query (within this topic) once I build it

 I have included a sample screenshot of the Acumatica Audit History page where I have field level tracking enabled.  ie  TOOLS> AUDIT HISTORY

2023 09 08 11 16 40

Topic Tags
SQL Audit History Generic Inquiry
3 Replies
Charles Craig
Posts: 21
 Charles Craig
September 8, 2023 11:41 am
(@charles-craig)
Eminent Member
Joined: 4 years ago

One of these? AUAuditField looked promising. 

Screen Shot 2023 09 08 at 11.39.49 AM

 


Reply
Kurt Bauer
Posts: 45
 Kurt Bauer
September 8, 2023 3:47 pm
(@kurtybauer)
Trusted Member
Joined: 5 years ago

The table is AuditHistory, but it is not easily readable because of how Acumatica stores the audited data and columns in single fields.  Here is a query that looks up the Audit History for document SO123456.  I left a couple filters for specifying table name or operation for reference.  I have used a version of this when a client deletes a order with a lot of lines and they want to review the data to recreate the order.

select
  CompanyID, 
  BatchID, 
  ChangeID, 
  ScreenID,
  (Select top 1 username from Users u where PKID = UserID) AS 'User', 
  ChangeDate, 
  Operation,
  TableName,
  REPLACE(CAST(CAST(CombinedKey AS VARCHAR(max)) AS VARBINARY(max)),   0x0, ',') AS 'Document',
  REPLACE(CAST(CAST(ModifiedFields AS VARCHAR(max)) AS VARBINARY(max)),   0x0, ',') AS 'Data Fields'
from AuditHistory
Where CompanyID=2 and CombinedKey like '%SO123456%' --and TableName='SOOrder'
	--AND Operation IN ('I' ,'U')
Order by CombinedKey,ChangeDate

Good luck.

Kurt


Reply
Henry Marambio
Posts: 4
 Henry Marambio
Topic starter
September 8, 2023 3:52 pm
(@hmarambio)
Active Member
Joined: 3 years ago

Kurt

Yes thanks for the clarification -- the combinedkey and modifiedfields fields is part of what was causing me heartburn.  I'll review and get back you, but I think this will let me move on to next steps


Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Related Topics
  • Run an SQL Script at Time of Save
    2 years ago
  • Join BCSYNCSTATUS to SOSHIPMENT table
    3 years ago
  • Tuning a PCS Server
    5 years ago
  • Business Events with GI to Excel without creating a new report
    5 years ago
  • How to Email to address not linked to entity
    5 years ago
Topic Tags:  SQL (4) , Audit History (3) , Generic Inquiry (41) ,
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 10 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.

‹›×

    ‹›×