
328 N.W.2d 308 (1982)
Bernice TROESTER, Administrator of the Estate of Larry A. Troester, deceased, Appellant,
v.
SISTERS OF MERCY HEALTH CORPORATION a/k/a Mercy Health Center, a/k/a Mercy Medical Center a/k/a St. Joseph's Mercy Hospital of Dubuque a/k/a St. Joseph's Unit of Mercy Medical Center; Dubuque County, Iowa and Medical Associates, a partnership, Appellees.
No. 67000.
Supreme Court of Iowa.
December 22, 1982.
*309 Joseph P. Zwack, Dubuque, for appellant.
Alfred E. Hughes of Hughes, Trannel & Jacobs, Dubuque, for appellee Sisters of Mercy Health Corp.
Michael J. Coyle of Fuerste, Carew, Coyle, Juergens & Sudmeier, Dubuque, for appellee Dubuque County.
Robert M. Bertsch and Richard K. Whitty of O'Connor, Thomas, Hammer, Bertsch & Norby, Dubuque, for appellee Medical Associates.
Considered by REYNOLDSON, C.J., and HARRIS, LARSON, SCHULTZ, and CARTER, JJ.
SCHULTZ, Justice.
This appeal results from the trial court's sustension of defendants' motions to dismiss the wrongful death action that plaintiff, Bernice Troester, brought as administrator of the estate of her husband against Sisters of Mercy Health Corporation, Dubuque County, and Medical Associates. These motions were filed after the pleadings were *310 completed, but before trial was to begin. They did not challenge deficiencies contained in the pleadings, but raised a question of subject matter jurisdiction based on postpleading events. We treat these identical motions as a single motion to dismiss and find it has no merit. Consequently, we reverse and remand for further proceedings.
Although plaintiff raises several issues, we need consider only a procedural question and a substantive matter. Plaintiff contends that the trial court erred procedurally by relying on matters beyond the pleadings in ruling on a prohibited "speaking motion." Plaintiff also contends that the court erred in ruling that when the decedent's estate was closed and the plaintiff discharged as administrator, plaintiff's authority to proceed with the wrongful death action terminated. Defendants argue that the closing of the estate and the discharge of the administrator terminated the trial court's subject matter jurisdiction over the wrongful death action. They further argue that they can raise, and the district court can rule upon, a question of subject matter jurisdiction at any time. We hold, as did the trial court, that when a question of capacity to sue is raised under an agreed set of facts, the court may consider these facts in deciding that question. We further conclude that the motion to dismiss should not have been granted; the mere closing of the estate and discharge of the administrator did not extinguish the cause of action for wrongful death.
On November 27, 1978, plaintiff brought a timely action for the wrongful death of the decedent. In their answers defendants admitted plaintiff was acting as administrator. The case was assigned for jury trial, but a few weeks before the trial was to begin the defendants filed a motion to dismiss. This motion alleged that decedent's estate had been closed and that plaintiff had been discharged as administrator. The defendants argued that the court no longer had subject matter jurisdiction over the wrongful death action, and that the action should be dismissed.
Plaintiff filed a resistance to this motion. She contended that decedent's estate had been reopened and that she had been reappointed as administrator pursuant to Iowa Code section 633.489 (1981). She attached to the resistance a copy of the court order from the probate proceedings. This order approved the application to reopen the estate and to reappoint plaintiff as administrator. Plaintiff also urged in the resistance that defendants' motion to dismiss was a prohibited speaking motion and that, at most, the proper remedy would be a substitution of the proper party in interest, rather than a dismissal of the cause of action.
The motion was set for hearing. Apparently, the district court heard the arguments of counsel; however, we have no record that evidence was produced or heard. The court did sustain the motion to dismiss, although it questioned the procedure by which the issue was presented. Nonetheless, it concluded "that in the interest of cost and time to the parties that it should be ruled on at this time."
Although the parties have raised matters subsequent to the court's ruling, we shall on this appeal consider only those motions and facts which were available to the trial court at the time it made its ruling. We will therefore confine our examination to the rulings on the speaking motion and the lack of subject matter jurisdiction.
I. "Speaking motion." A motion to dismiss is generally based on the claim that the pleader has failed to state a claim upon which any relief may be granted. Iowa R.Civ.P. 104(b). The thrust of the motion to dismiss is directed at the pleadings and, consequently, facts not contained in the pleadings will not be considered. Berger v. General United Group, Inc., 268 N.W.2d 630, 634 (Iowa 1978).
Plaintiff points out that the undisputed pleadings show she is the acting administrator and she argues that the court should have looked no further. She claims that despite our rule the district court considered the factual allegations of the motion to dismiss and the resistance, or else took judicial notice of the probate proceedings in *311 decedent's estate. She contends that either of these actions constitutes reversible error.
Turning first to the matters contained in the probate file, we conclude that it was improper for the district court to consider or to take judicial notice of the records of the same court in a different proceeding, without an agreement of the parties. McCarthy v. McCarthy, 162 N.W.2d 444, 447 (Iowa 1968); Bales v. Iowa State Highway Commission, 249 Iowa 57, 63, 86 N.W.2d 244, 248 (1957). The parties have had no opportunity to present their respective positions through an evidentiary hearing on matters contained in the probate file. It is possible that some of these matters, such as the propriety or legality of either the closing or the reopening of the estate, could affect the outcome of this case. Whether consideration of the probate file is reversible error, however, depends on the sufficiency of other admissible facts before the court.
Both parties have admitted that subsequent to the pleadings decedent's estate was closed and then reopened. Thus, without agreeing to the legality of the acts, it is undisputed that the plaintiff was discharged as administrator by the court and was subsequently reappointed. We conclude that these undisputed facts were before the court and it was proper for the court to have considered them in ruling on the motion to dismiss. Moreover, these facts are relevant to the issue contained in the motion.
Although we do not decide whether the thrust of the motion was based on subject matter jurisdiction or on capacity to sue, we do conclude that the court may decide either issue at any time in an action when it has the necessary facts in the record before it. We have indicated that questions of subject matter jurisdiction may be raised at any time. In re Estate of Dull, 303 N.W.2d 402, 406 (Iowa 1981); Lloyd v. State, 251 N.W.2d 551, 556-57 (Iowa 1977); Green v. Sherman, 173 N.W.2d 843, 846 (Iowa 1970). We stated in Walles v. International Brotherhood of Electrical Workers, 252 N.W.2d 701, 710 (Iowa 1977), that:
Every court has inherent power to determine whether it has jurisdiction over the subject matter of the proceedings before it. It makes no difference how the question comes to its attention. Once raised, the question must be disposed of, no matter in what manner of form or stage presented. The court on its own motion will examine grounds of its jurisdiction before proceeding further.
We have also indicated that it is proper to challenge a plaintiff's capacity to sue by a motion to dismiss based on facts that occurred subsequent to the filing of the petition. Dumbaugh v. Cascade Manufacturing Co., 264 N.W.2d 763, 765 (Iowa 1978).
These holdings are sensible and we find it reasonable to adopt procedures that will avoid the time and cost of a trial on the merits when either the trial court or a party lacks authority to proceed. We also suggest that, in those cases where evidence is required on these questions, it is a better practice to utilize in the pretrial stage of the case our summary judgment procedure. Iowa R.Civ.P. 237-240. In the present case the motion to dismiss is not directed at deficiencies in the pleadings pursuant to Iowa R.Civ.P. 104. Instead, it is founded on facts that arose after the pleadings had been filed. In this limited situation we find it reasonable to follow the lead of one commentator who suggests that, in motions to dismiss "where matters outside the pleadings are relied upon in support of the motion, the proper procedure is to treat the motion as one for summary judgment." A. Vestal & P. Willson, Iowa Practice § 1506(1) (1974).
We emphasize that our approval here of the reliance by the district court on admitted facts not contained in the pleadings has a narrow and limited application. We still do not approve of "speaking motions" directed to deficiencies in the pleadings. However, as capacity to sue became an issue subsequent to the pleadings and was raised in a motion to dismiss, we find that it was proper for the court to consider undisputed facts in ruling on the motion.
*312 II. Capacity to sue. In sustaining the motion to dismiss, the district court concluded that the relief for wrongful death is vested exclusively in the personal representative of the estate of the deceased. It further determined that the representative must maintain a capacity to sue and, in this case, that the authority of the personal representative to proceed with this action terminated upon the closing of the estate. The court finally concluded that the cause of action went out of existence, the subsequent reappointment of the personal representative did not restore the original cause of action, and a new cause of action would be barred by the statute of limitations.
Plaintiff urges that the wrongful death action should not have been precluded once it had been properly commenced. She further contends that nothing in the law extinguishes the action because she is no longer the administrator. She points out that section 633.489 implies that the suit may be continued for it allows an estate to be reopened "if any necessary act remains unperformed" and it provides that the court may reappoint a personal representative to perform "such acts as may be deemed necessary."
Initially, we shall review certain statutes and principles concerning actions for wrongful death. Iowa recognizes no common law action for wrongful death and the power to maintain such action is entirely statutory. Egan v. Naylor, 208 N.W.2d 915, 917 (Iowa 1973). Iowa Code section 611.20, a survival statute, keeps alive for the benefit of the decedent's estate the cause of action which the deceased prior to his death could have brought had he survived the injury, with recovery enlarged to include the wrongful death. Id. Iowa Code section 611.22 provides that only the legal representative has authority to bring the action, whereas Iowa Code sections 613.15 and 633.336 outline the measure of recovery and provide for the apportionment of the recovery between the spouse, parent, and the estate. Wilson v. Iowa Power & Light Co., 280 N.W.2d 372, 374 (Iowa 1979). In maintaining the wrongful death action the personal representative acts in the capacity of a trustee for the benefit of the recipient of the damages. Flynn v. Chicago Great Western Railroad Co., 159 Iowa 571, 575, 141 N.W. 401, 402 (1913).
We have consistently held that these code sections vest the right to recover wrongful death damages exclusively in the estate representative. Wilson, 280 N.W.2d at 373; Egan, 208 N.W.2d at 918. However, we have also held that the estate representative may assign a death claim with full power to bring the action in the name of the assignee. Archibald v. Midwest Paper Stock Co., 158 N.W.2d 739, 742 (Iowa 1968); Barrett v. Chicago, Milwaukee & St. Paul Railroad Co., 190 Iowa 509, 524, 175 N.W. 950, 957 (1920); Flynn, 159 Iowa at 575, 141 N.W. at 401. We have also determined that when a death action is assigned by operation of law, such as by a subrogation, the action may be not only maintained but may also be commenced by the subrogee. Iowa National Mutual Ins. Co. v. Chicago, Burlington & Quincy Railroad Co., 246 Iowa 971, 981, 68 N.W.2d 920, 924-25 (1955) (authority to commence action found in Workmen's Compensation Act).
The motion to dismiss in this case was directed to the lack of subject matter jurisdiction of the court. No challenge was made that the court lacked jurisdiction to initially hear the case. Instead, the claim was made that the administrator no longer was entitled to maintain the action because the estate had been closed. The district court correctly recognized that this claim was in reality a challenge to the plaintiff's capacity to maintain the action. It concluded that the plaintiff lost this capacity because the closing of the estate extinguished the cause of action. It further reasoned that the plaintiff could not regain it by reopening the estate.
We have long recognized that a party plaintiff must have capacity to sue in order to commence and maintain a cause of action. Dumbaugh, 264 N.W.2d at 765 (a discharged trustee in bankruptcy who neither took action to be reinstated nor had a successor brought in and substituted for *313 him, did not have capacity to sue and the action should have been dismissed); Pearson v. Anthony, 218 Iowa 697, 700, 254 N.W. 10, 12 (1934) (a plaintiff lacked capacity to bring an action on behalf of an estate when she was not the personal representative); Steamboat Pembinaw and Owner v. Wilson, 11 Iowa 479, 480 (1861) (neither a steamboat, a tollgate, nor a racehorse has the capacity to sue). Stated otherwise, a party plaintiff must have a legal entity, or a legal existence, in order to come into court and commence an action. 67A C.J.S. Parties § 10 (1978); 59 Am.Jur.2d Parties § 21 (1971).
There is no question that the plaintiff possessed capacity when she commenced the wrongful death action. What we must decide, however, is the effect, if any, on this action by the closing and reopening of the estate.
We hold that the closing of the estate does not automatically terminate or abate a pending action commenced on behalf of an estate, although, at some period a successor or assignee must come forward to replace the plaintiff. Initially, we believe that the capacity to sue must be distinguished from the cause of action for wrongful death. A capacity to sue is the right of a party to come into court, while, on the other hand, a cause of action is the claim itself, the right to relief in court. 1 C.J.S. Actions § 8(j) (1936). While it is necessary that there be a party plaintiff to commence and maintain a cause of action, the parties and the claim are separate and they exist apart from each other. Generally, the discharge or removal of the personal representative of an estate does not abate a pending action. 1 C.J.S. Abatement and Revival § 110(b) (1936). Iowa R.Civ.P. 20 provides that when any person in a representative capacity ceases to be such while a party to a suit, the court may order his successor brought in and substituted for him. See also Iowa R.Civ.P. 15 (substitution of a legal representative or successor in interest for a deceased party); Iowa R.Civ.P. 16 ("[t]ransfer of an interest in a pending action shall not abate it, but may be the occasion for bringing in new parties); Iowa R.Civ.P. 17 (incompetent parties shall have a guardian ad litem appointed); Iowa R.Civ.P. 18 (nonabatement in case of guardianship due to the death or removal of the guardian or death of the ward, with a substitution to be made by the court).
The defendants point out that the estate proceedings were terminated and they urge that under the authority of Cuppy v. Coffman, 82 Iowa 214, 47 N.W. 1005 (1891); Jordan v. Hunnell, 96 Iowa 334, 65 N.W. 302 (1895); and Dumbaugh v. Cascade Manufacturing Co., 264 N.W.2d 763 (Iowa 1978), the plaintiff lost capacity to maintain the action and that this loss cannot be remedied by her reappointment.
In both Cuppy and Dumbaugh the fiduciary had been discharged and had not been reappointed at the time of the hearing. Moreover, in Dumbaugh the bankruptcy estate had been closed. However, unlike the situations in Cuppy and Dumbaugh, the plaintiff administrator in this case had been reappointed and the estate reopened prior to trial. We are able to distinguish Cuppy and Dumbaugh because the status of the plaintiff in those cases was clearly different. Thus, neither case supports the contentions of the defendants. Indeed, language in the Cuppy decision indicates that when an administrator is removed and not reappointed prior to the hearing, the court ought in ordinary cases to continue the cause and allow the reappointment of the fiduciary to take place. Cuppy, 82 Iowa at 216, 47 N.W. at 1006. In addition, although we held in Dumbaugh that no defendant should be forced to trial where the plaintiff fiduciary lacked capacity to sue, we also pointed out that a transfer of interest does not abate the action and that the plaintiff did not avail himself of rule 20, which allows a successor to a discharged trustee to be brought in and substituted as a party. Dumbaugh, 264 N.W.2d at 765.
In Jordan, an estate was closed and the administrator was discharged. The estate was later reopened for the purpose of bringing a suit to collect a debt. The court held that there was no jurisdiction to order *314 further administration because the asset, the debt, was vested in the heirs upon the closing of the estate. Jordan, 96 Iowa at 337-38, 65 N.W. at 303. Without deciding whether the wrongful death action vested in the spouse and children of the deceased, we hold that the pronouncements in Jordan are of no aid to the present defendants. Defendants have moved to dismiss the action on the basis that the action has extinguished or abated. Jordan indicates that the action in that case vested in the heirs, that is, it was a transfer of interest. Rule 16 provides that a "[t]ransfer of an interest in a pending action shall not abate it, but may be the occasion for bringing in new parties." (Emphasis added). Thus, the action would continue because the action would not abate.
The defendants further argue that although section 633.489 allows the reopening of an estate, it precludes the assertion of a claim which is already barred. This argument is premised on defendants' claim that the cause of action was extinguished when the estate went out of existence. They contend that the claim could not be reasserted because it was not brought within the statute of limitations. We have previously indicated that the closing of the estate did not extinguish the pending action. We find no merit in defendants' argument.
As indicated earlier, issues were raised as to matters that were either not properly before the trial court in an adversary setting or were matters raised subsequent to the ruling on the motion appealed from. We confine our ruling to matters properly before the court in deciding the motion to dismiss. We hold that the mere closing of the estate did not abate the action and, as she was reappointed, it did not prevent the plaintiff administrator from regaining her capacity to act. The questions of the legality of the closing and the reopening of the estate and the determination of the real party in interest were not before the district court on the motion to dismiss. We hold that the district court was in error when it sustained the motion to dismiss.
This matter is remanded for further proceedings.
REVERSED AND REMANDED.
