@Marawan مَرَوَان You can achieve this using either a Workflow or SuiteScript by adding a condition to check whether the selected Location has a parent or not depend on your exact requirement.
If the Parent Location is empty, then it means the selected Location is a top-level/parent Location, so we can prevent the user from selecting it or saving the transaction.
We can handle this in two ways:
• Using a Client Script to validate it as soon as the user selects the Location.
• Using a User Event Script to prevent the user from saving the transaction if a parent Location is selected.
Personally, I’d suggest going with SuiteScript, as it gives us more flexibility, especially if the Location is being selected at the line level. I don’t think Workflow would handle the line-level validation as smoothly due to some system limitations.