Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Trigger Error Object Has No Reference

Posted on by Microsoft Employee

Hi,

I wrote a trigger to update the EFT fields during cash receipt.  The trigger works but when I post the RM Batch I receive the batch error 'Object has no reference".  I ran the grant script but this did not resolve the problem.

Suggestions anyone?  The trigger is below.

Thank you,

Donnette

/****** Object: Trigger [dbo].[palbInvc_EFTFlagUpdate] Script Date: 5/10/2017 1:55:25 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author: DONNETTE SPENCER,
-- Create date: 05/04/2017
-- Description: UPDATE RMCASH APPS TABLE EFT FLAG =1= WHEN LOCKBOX PAYMENT IS APPLIE TO A CUSTOMER ACCOUNT
-- =============================================
CREATE TRIGGER [dbo].[palbInvc_EFTFlagUpdate] ON [dbo].[palbInvc]

AFTER INSERT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for trigger here to update eft flag in the RM10201 table

Update
R SET R.EFTFLAG = '1'
FROM RM10201 R
inner join [palbInvc] LB ON R.DOCNUMBR = LB.[DOCNUMBR]
--WHERE LB.[CUSTNMBR] <> ''

Update
R SET R.TRXDSCRN = 'EFT TRANSACTION'
FROM RM10201 R
inner join [palbInvc] LB ON R.DOCNUMBR = LB.[DOCNUMBR]
WHERE R.EFTFLAG = '1'
END

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trigger Error Object Has No Reference

    The business uses the Lock Box process to record EFT payments only, therefore they want the EFT box always checked and the description updated. I will try your suggestion.

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: Trigger Error Object Has No Reference

    Your trigger seems to be a bit aggressive - updating everything no matter what has changed.

    I'd expect to see a join with

    UPDATED

    or

    DELETED

    ?

    I don't know the data flow for this business operation so can't comment more.

    Tim.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans