Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:50:43+00:00 2026-05-23T21:50:43+00:00

Using Great Plains here and one of our users keeps screwing up customer data

  • 0

Using Great Plains here and one of our users keeps screwing up customer data so we want to put a trigger on the customer table and so we can find out who it is.

Anyway, I created a table called audit_RM00101 as follows:

DATE        nchar(10)   
CUSTNMBR    char(15)    
CUSTNAME    char(65)    
UPSZONE     char(3) 
SALSTERR    char(15)    
USERID      nchar(100)

I want to capture those same fields from the table I want to audit so I wrote the trigger as follows:

CREATE TRIGGER CatchCustomerRegionUpdate
ON RM00101
FOR UPDATE
AS
DECLARE @UserID VARCHAR(128)
SELECT @UserID = system_user
INSERT INTO audit_RM00101 
SELECT DATE, CUSTNMBR, CUSTNAME, UPSZONE, SALSTERR, @UserID FROM UPDATED

The trigger gets created just fine but when I try to test it by updating a customer record in Great Plains, Great Plains throws up an ugly error and the trigger doesn’t get fired.

What am I doing wrong here?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:50:44+00:00Added an answer on May 23, 2026 at 9:50 pm

    in a trigger, you get the DELETED and INSERTED tables, there is no UPDATED, so replace FROM UPDATED with FROM INSERTED

    also try to fix your USERID column, your audit_RM00101.USERID is a nchar(100) while @UserID is a VARCHAR(128).

    EDIT based on OPs comment: Ah, so there is no way to audit when a table is updated by using a trigger?

    • in a trigger when deleting, DELETED is populated, but INSERTED is empty
    • in a trigger when updating, DELETED is populated with the original value, and INSERTED is populated with the newly updated values
    • in a trigger when inserting, DELETED is empty, but INSERTED has the newly inserted values
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using Lucene to great effect to provide a solution where my users
I'm using plain English here. I've got this great app with multiple tabs and
I'm using this great plugin: http://www.sanisoft.com/blog/2009/06/22/jquery-auto-correct-plugin/ But it's not working with 1.6.2 or greater...
I'm using the great jquery-file-upload image uploader, but need to store images for different
I had an old (but great) app using NHibernate 1.0.2. Worked like a charm.
Using cURL_multi is great for simultaneous connections, but what can limit the number of
I'm using Omnifaces FullAjaxExceptionHandler - which is working great, but when I do an
I'm using Install4J mostly for it's great jar file optimization and support for pack200.
I'm using such code which works great on IE and Firefox: .tytulmalykom { color:#666666;
I'm using XSLT and having great success, just got a couple of problems. Warning:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.