DynDeveloper.com

DynDeveloper.com

Sign Up Now! Log In
Simon 4/20/2018 1:20:15 PM

taRMApply Wrapper

* This article, and all our great SQL (Dynamics) documentation, Is available on the SQL (Dynamics) menu

It seems that every day I get a call to do something new. 

Today's newness is this: The client is in the habit of writing returns that have the same document number as the corresponding invoice. In practice, most invoices have a small return. 

These are all sitting in the RM Open table, unapplied. Lots of them. 

Task: Create a stored procedure that will search the RM20101 (RM Open) table and return all matching unapplied credits and invoices, and then automatically apply them. 

Care to comment on my approach? Can you improve the code?

The working stored procedure is below, fully commented. 

Version: Unknown or N/A
Section: SQL Scripts