It isn't mandatory, but many lenders will only offer an agreement in principle in advance of granting planning permission.