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.

Mohammad R. Daoud MVP - MCT
+962 - 79 - 999 65 85


-- =============================================
-- 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
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.

-- Insert statements for trigger here

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)


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

joecoles222 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

allhelplinesupport3046 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

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

Related Posts:

Related Posts with Thumbnails