Thursday, December 6, 2012

Auto Assign Newly Added Analytical Accounting Code to All Users

I got a request from one of my customers, they had a need to auto assign newly created AA codes to all users and that how the idea started, I saw the scripts created by Sivakumar earlier to auto assign all codes to all users and used his cross join to create the below trigger.

The trigger is simply works on AAG00401 table upon record insert, it assigns the newly created codes to all GP users automatically, just run below script over your company database and enjoy.

Regards,
--
Mohammad R. Daoud MVP - MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 - 79 - 999 65 85
me@mohdaoud.com
http://www.di.jo

 

-- =============================================
-- Author : Mohammad R. Daoud
-- Create date: 09:56 AM ‎07/‎12/‎2012
-- Description: This trigger as created to auto assign
-- newly created analytical accounting codes to all users.
-- =============================================
CREATE TRIGGER DI_AutoAssignSecurity
ON AAG00401
FOR 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
DECLARE @aaTrxDimID INT
DECLARE @aaTrxDimCodeID INT

SELECT TOP 1 @aaTrxDimID = aaTrxDimID, @aaTrxDimCodeID = aaTrxDimCodeID FROM INSERTED
DELETE FROM AAG02000 WHERE aaTrxDimID = @aaTrxDimID AND AAG02000.aaTrxDimCodeID = @aaTrxDimCodeID
INSERT INTO AAG02000 (USERID, aaTrxDimID, aaTrxDimCodeID, aaDistribute, aaAdjust) (SELECT B.USERID, A.aaTrxDimID, A.aaTrxDimCodeID, 1, 1 FROM AAG00401 A CROSS JOIN DYNAMICS..SY01400 B WHERE A.aaTrxDimID = @aaTrxDimID AND A.aaTrxDimCodeID = @aaTrxDimCodeID)
END
GO

13 comments:

Evan Marcus said...

Thanks for taking time for sharing this article, it was excellent and very informative. Its really very useful of all of users. I found a lot of informative stuff in your article. Keep it up.
Steering Rack

joecoles said...

" Investment Club Accounting has never been easier. Discover a step-by-step process to running the accounts for your investment club"

….How to free up time, save headaches and make your life easier!

Find out here: Investment Club Accounting?

Thanks again

Seema Singh said...
This comment has been removed by a blog administrator.
Wilda Jones said...

Microsoft edge support
Mozilla Firefox Support Phone Number
Quickbooks Support Phone Number
pogo games support phone number
yahoo mail customer service phone number

Bello Rock said...

free llm mock test
llb test series
llm entrance test
free clat mock test

AllHelplineNumber said...

Avast Customer Service Number is the best available number for fixing all kind of avast issues around the clock across USA. We have a dedicated team of experts who provide assistance to all avast customers over phone call ,chat and emails. So feel free to call at our Avast tech support phone number 1-855-499-1999 for best service at a very minimum cost.
Avast Customer Service

shalley30 said...

On the off chance that you are chipping away at the web, specialized issues will consistently be there and you need to work remembering them and continually being set up to deal with them at whatever point they arise. yahoo support number

All Customer Service Number said...

Webroot Antivirus is the strong antivirus software which provides ultimate protection for your PC. The webroot free antivirus software defends your PC against viruses, threats, malware, spyware, ransom ware, and other online threats. For any query you can click on the given link www.webroot.com/safe.

If you want to download setup of MS Office, so you can download it from here Office.com/setup.

shalley30 said...

Office 2019, 365, Step by Step Office Setup with product key Visit office.com/setup and follow the instructions for office setup.After signing in, follow the steps that match the type of account you signed in with. From the Office home page select Install Office.if you have any query related to ms office then contact us.

office.com/setup

All Customer Service Number said...

You can learn from the help of our blog on how is Microsoft Impacting competition. You can read it by click on the following link "Microsoft Impacting competition?"

Garmin GPS said...

My travel life have been easier with Garmin Express. Plus I can get all the additional knowledge through their blogs. I use the Garmin app and is totally upto the mark. I recommend everyone to use Garmin Map Update and get Garmin life time map update or call +1-888-309-0939 for instant help from Garmin GPS experts.

Daniel Smith said...

I did not know the entire benefits of Garmin Nuvi Update. But since I have read this blog on map update, I have installed all available updates for my garmin device. I must say that this piece of blog has helped me improve navigation experience. I am not suggesting all my friends to read this blog and get Garmin.com/Express with this team. For detailed information, you can contact us at toll-free number +1 888-309-0939. Our Garmin GPS professionals will provide instant help.

Latest Govt Jobs in India said...

Get free notification of all India Government Jobs 2020 and its job vacancies across sectors in India like Railways, Banking Employment in India, Universities, College Govt Jobs, Teaching, Schools in India, Financial Institutions 2020, Defense, SSC, Agriculture and many more India Government Jobs.Visit: https://www.governmentjobseeker.com

Related Posts:

Related Posts with Thumbnails