How to write code that covers all companies

hi guys,

what is the code to effect all companies?


set allowed posting from, allowed posting date to to beginning of the month when i run a particular company.

i have 10 companies, but i would like to run the codeunit once to update date of allowed posting from/to.