Salesforce records often form part of a deep and wide hierarchy; for example, an account can contain a number of cases, each of which can have a number of comments associated with them. Creating and maintaining the elements of the hierarchy in isolation is a cumbersome and time-consuming task, as to add a comment a user must click through from the account record to the case record, and then click on the New button on the case comments related list to open the new comment page.
In this recipe we will create a Visualforce page that allows a user to maintain an account, its associated cases, and the comments associated with those cases. The user can update or delete existing records, or create new records at any level of the hierarchy.