I guess the relevant maintenance schedules will list the occasions when a direct reading compass must be reswung but a few spring to mind:-
Whenever there is a significant change in a/c components which might affect deviation - eg new wing etc!
At certain calendar periods (two years ?)
Whenever the correct operation of the compass is in doubt - pilot report in tech log?
Hope this helps a little