When it appears during the course of any hearing or proceeding that some action or remedy other than those indicated by the application or pleading is appropriate, the court, with the consent of all necessary parties, may proceed to hear and determine the additional or other issues as though originally properly sought and pleaded.
Iowa Code § 232.40