Mass Updating Vendor Defaults in SQL

We have a sql script template that can help you mass update your vendor default GL Codes if necessary

Fidesic works best when there is a default GL code set up for each vendor, even if it's just a placeholder code as our OCR can update location/entity segments using this default. 

These scripts must be run on the individual company databases within GP, rather than the dynamics database. 

 

Make sure to replace ##Default GL Code## with an actual, valid, code. 

Return all Vendors without defaults set: 

select 
v.VENDNAME, v.VENDORID, v.VNDCHKNM, v.PYMTRMID, v.VENDSTTS, v.VNDCLSID, v.DEX_ROW_ID, v.ACNMVNDR , v.PMPRCHIX, g.ACTINDX, g.ACTNUMST
FROM PM00200 AS v 
JOIN GL00105 AS g ON g.ACTNUMST='##Default GL Code##'
where ISNULL(v.PMPRCHIX,0) = 0

 

Set Vendors without Default GL Code to specific code: 

update v set PMPRCHIX = g.ACTINDX
FROM PM00200 AS v 
JOIN GL00105 AS g ON g.ACTNUMST='##Default GL Code##'
where ISNULL(v.PMPRCHIX,0) = 0