This error message is very straight forward. It tells the user that the Department with Internal ID (represented by ##. For this example we will use 7) is not valid.
It could be due to a number of reasons such as;
a.the Department record is set to Inactive.
To check this, navigate to Setup>Company>Department and edit the Department record with Internal ID 7.
b.the primary Department in which Department (ID:7) is a Subdepartment of is set to Inactive
c.for OneWorld; the Subsidiary associated to Department (ID:7) is set to Inactive