Tuesday, June 12, 2012

Handy Scripts for Retirement Plan Checkbox

Many a user has been disappointed at year end to print their W-2s, and even maybe send them out, before noticing that the pesky little retirement plan checkbox wasn't marked (Cards-Payroll-Tax Information).  I was just migrating some payroll data for a client, and used the following scripts to update the checkbox for all employees that have a 401k deduction assigned (even if the amount is zero).  As always, make a backup and run these in a test environment to ensure that they work for your purposes:

--identify employees who have a 401k deduction
select UPR00300.EMPLOYID, UPR00300.W2BFPPLN, UPR00500.DEDUCTON

from UPR00300 inner join UPR00500 on upr00300.EMPLOYID=upr00500.EMPLOYID
where (UPR00500.DEDUCTON='insert 401k deduction code' or UPR00500.DEDUCTON='insert another 401k deduction code')
--update employees who have a 401k deduction so that the Retirement Plan checkbox is marked in Cards-Payroll-Tax Information
update UPR00300 set UPR00300.W2BFPPLN=1
from UPR00300 inner join UPR00500 on UPR00300.EMPLOYID=UPR00500.EMPLOYID
where (UPR00500.DEDUCTON='insert 401k deduction code' or UPR00500.DEDUCTON='insert another 401k deduction code')

Have fun!

Christina Phillips is a Microsoft Certified Trainer and Dynamics GP Certified Professional. She is a supervising consultant with BKD Technologies, providing training, support, and project management services to new and existing Microsoft Dynamics customers. This blog represents her views only, not those of her employer.

No comments: