Cannot find either column ‘dbo’ or the user-defined function or aggregate ‘dbo.fnInvoice_Credit_Amount’, or the name is ambiguous (Internal)

A close-up of a computer screenDescription automatically generated

 

If a user reports that they are receiving the above error, look for the dbo.fnInvoice_Credit_Amount function in the below location.

 

A screenshot of a computerDescription automatically generated

 

If the function is not present, run the below script to recreate the function.

 

/****** Object: UserDefinedFunction [dbo].[fnInvoice_Credit_Amount]   Script Date: 11/20/2024 3:51:34 PM ******/

 

SET ANSI_NULLS ON

GO

 

SET QUOTED_IDENTIFIER ON

GO

 

 

CREATE FUNCTION [dbo].[fnInvoice_Credit_Amount] 

   (@APInvoice_Id int)

   RETURNS money

AS

BEGIN

   DECLARE @Amount money

   SELECT @Amount = SUM(cd.Amount)

   FROM AP_Credit_Detail cd 

   WHERE cd.APInvoice_Id = @apinvoice_id

   RETURN @Amount

END

GO

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.