
708 N.E.2d 916 (1999)
R.P.D., By Next Friend, Patricia A. DICK, and Patricia A. Dick, Appellants-Petitioners, and
Indiana Advocates for Children, Inc., Guardian-Ad-Litem for R.P.D., and David L. Parker, Appellee-Respondent, and
Steven K. Dick, Appellee-Respondent Intervenor.
No. 49A02-9803-JV-199.
Court of Appeals of Indiana.
April 22, 1999.
*917 Monty K. Woolsey, Franklin I. Miroff, Miroff, Cross & Klineman, Indianapolis, Indiana, Attorneys for Appellant.
D. Robert Webster, Timothy Peterson, Bamberger & Feibleman, Indianapolis, Indiana, Attorneys for Appellee.

OPINION
STATON, Judge.
Patricia A. Dick ("Patricia") and R.P.D., by next friend Patricia A. Dick, appeal the trial court's grant of three motions to dismiss their petition to determine the paternity of R.P.D. The motions were filed by Steven K. Dick ("Steven"), David L. Parker ("Parker"), and Indiana Advocates for Children, Inc., R.P.D.'s guardian ad litem ("GAL"). Patricia and R.P.D. raise three issues on appeal, which we consolidate and restate as one: whether the trial court erred by dismissing their paternity petition.
We affirm.
The following facts are undisputed. Patricia and Steven were married on May 31, 1986. Patricia and Steven remained married on June 3, 1991, the date R.P.D. was born. Patricia had sexual intercourse with both Steven and Parker approximately nine months prior to R.P.D.'s birth. Patricia and Steven remain married, although a dissolution proceeding, which has been consolidated with Patricia and R.P.D.'s paternity petition, is ongoing. On December 10, 1996, Patricia, Parker, and R.P.D., by next friends Patricia *918 and Parker, filed a petition to establish Parker's paternity of R.P.D. Parker was later dismissed from this petition at his own request. On May 9, 1997, Patricia and R.P.D., by next friend Patricia, filed an amended paternity petition, seeking to establish Parker's paternity of R.P.D. Steven, Parker, and R.P.D., through his GAL, each sought dismissal of this petition. Following an evidentiary hearing, the trial court granted the motions to dismiss, concluding that Patricia is barred by the statute of limitations, estoppel, and laches from challenging Steven's paternity of R.P.D. and that the paternity petition was not in the best interests of R.P.D. This appeal ensued.
Patricia and R.P.D., by next friend Patricia, contend that the trial court erred by dismissing the paternity petition. Initially, Patricia argues that this court should utilize a summary judgment standard of review. Before addressing the appropriate standard, we note that even if we were to apply the summary judgment standard, it is clear that Patricia is barred, as a matter of law, from pursuing the paternity action.
IND.CODE § 31-14-4-1 (Supp.1997) permits a mother to file an action to establish the paternity of her child. However, a mother must file such an action not later than two years after the child is born unless certain exceptions are applicable. IND.CODE § 31-14-5-3(b) (Supp.1997). Since it is undisputed that Patricia did not file her petition within two years of R.P.D.'s birth, and she did not allege that any of the exceptions apply, the trial court did not err in concluding that Patricia is barred by IC XX-XX-X-X(b) from maintaining the paternity action on her own behalf. Furthermore, the trial court did not err in concluding that Patricia may not otherwise deny the presumption of legitimacy between Steven and R.P.D. since a paternity action under IC 31-14 is the exclusive means by which a man's paternity may be established. IND.CODE § 31-14-2-1 (Supp.1997).
Although Patricia's petition is time-barred, the two year statute of limitations does not apply to R.P.D. A child may file a paternity petition at any time before he reaches the age of twenty. IND.CODE § 31-14-5-2(b) (Supp.1997). If the child is incompetent, he may file the petition through his guardian, guardian ad litem, or next friend. IC XX-XX-X-X(a). Here, R.P.D. filed a petition before his twentieth birthday through his next friend, Patricia.
The difficulty in this case arose because both Patricia and R.P.D.'s court-appointed GAL were attempting to represent the interests of R.P.D., who at six years of age was incompetent to make these decisions himself. Both Patricia, as R.P.D.'s next friend, and the GAL were required to act in R.P.D.'s best interest. See IND.CODE § 31-32-3-6 (Supp.1997) ("A guardian ad litem ... shall represent and protect the best interests of the child."); 1 HOMER H. CLARK, JR., THE LAW OF DOMESTIC RELATIONS IN THE UNITED STATES 559 (2d ed. 1987) ("Where the ward initiated the suit, he was traditionally represented by a `next friend', while the guardian ad litem represented the ward as defendant, but the functions of both are the same ..."); Ind. Trial Rule 17(C) ("An infant or incompetent person may sue or be sued in any action... in his own name by a guardian ad litem or a next friend ..."). Patricia, purporting to act in R.P.D.'s best interest, filed the paternity action as his next friend. Patricia asserts that it is in R.P.D.'s best interest to determine his biological father, whom Patricia alleges is Parker. In the GAL's motion to dismiss, it asserted that the paternity action was not in R.P.D.'s best interest. Because of this conflict, the trial court was required to determine, prior to reaching the merits, whether the paternity action was in R.P.D.'s best interest. If the paternity action was not in R.P.D.'s best interest, the trial court was required to dismiss it since neither Patricia, as next friend, nor the GAL could continue to prosecute an action on R.P.D.'s behalf where it was contrary to his best interest. Id. Following an extensive evidentiary hearing, the trial court concluded that the paternity action was not in R.P.D.'s best interest. Pursuant to Steven's request, the trial court prepared written findings of fact and conclusions of law. Steven contends that the appropriate standard of review is that which is applied to final judgments where written findings and conclusions have been requested by a party. Patricia argues *919 that a summary judgment standard should be applied. We agree with Steven.
The trial court dismissed the paternity petition following a hearing on Steven's, Parker's, and the GAL's motions to dismiss. In dismissing the petition, the court considered evidence outside the pleadings. Generally, when a court considers evidence outside the pleadings on a motion to dismiss for failure to state a claim upon which relief can be granted, the motion must be treated as one for summary judgment and disposed of as provided by Trial Rule 56. Dixon v. Siwy, 661 N.E.2d 600, 603 (Ind.Ct.App. 1996); Ind. Trial Rule 12(B). However, we need not apply this rule in this case.
First, Patricia could be dismissed without reference to any evidence outside the pleadings. Patricia alleged in the petition that the Child was born on June 3, 1991. Patricia's petition was first filed on December 10, 1996, over two years after R.P.D's birth. Accordingly, Patricia was barred from pursuing a paternity action on her own behalf. IC XX-XX-X-X(b).
Second, the court was required to hold an evidentiary hearing prior to proceeding to the merits of the paternity action in order to determine whether the petition was in R.P.D.'s best interest. A summary judgment proceeding, which Patricia alleges was the procedure the trial court should have followed, would not have permitted the trial court to conclusively determine whether the paternity action was in R.P.D.'s best interest. The proceeding held by the trial court resembled a proceeding held under T.R. 12(B)(1). When a party seeks dismissal of a case pursuant to T.R. 12(B)(1) for lack of subject matter jurisdiction, the trial court may consider evidence outside the pleadings. Davis v. Central Rent-A-Crane, Inc., 663 N.E.2d 1177, 1179 (Ind.Ct.App.1996). This differs from other motions to dismiss, where only the pleadings are considered, because the trial court must immediately resolve factual disputes that bear on its jurisdiction. Id. If the court lacks jurisdiction, it cannot enter any type of judgment, including summary judgment, and it must dismiss the case. Id. Like a case where the trial court must resolve a factual dispute to decide its jurisdiction, the trial court here was required to decide whether the action was in R.P.D.'s best interest prior to deciding the merits. Accordingly, a summary judgment standard of review is not appropriate.
Where a trial court has made special findings pursuant to a party's request under T.R. 52(A), the reviewing court may affirm the judgment on any legal theory supported by the findings. Mitchell v. Mitchell, 695 N.E.2d 920, 923 (Ind.1998). Before affirming a legal theory supported by the findings but not espoused by the trial court, the appellate court should be confident that its affirmance is consistent with all of the trial court's findings of fact and inferences reasonably drawn from the findings. Id. at 924. In reviewing the judgment, we must first determine whether the evidence supports the findings and second, whether the findings support the judgment. Ahuja v. Lynco Ltd. Medical Research, 675 N.E.2d 704, 707 (Ind. Ct.App.1996), trans. denied. The judgment will be reversed only when clearly erroneous. DeHaan v. DeHaan, 572 N.E.2d 1315, 1320 (Ind.Ct.App.1991), trans. denied. Findings of fact are clearly erroneous when the record lacks any reasonable inferences from the evidence to support them. Id. To determine whether the findings or judgment are clearly erroneous, we consider only the evidence favorable to the judgment and all reasonable inferences flowing therefrom, and we will not reweigh the evidence or assess witness credibility. Id.
Because Patricia has insisted that a summary judgment standard applies, she has failed to argue on appeal that specific factual findings by the court are in error or that the findings do not support the judgment. Patricia does contend that it is in R.P.D.'s best interest to determine his biological father. However, as indicated above, we consider only the evidence most favorable to the judgment in determining whether it is clearly erroneous. Our review of the record reveals that the trial court's judgment that the paternity action was not in R.P.D.'s best interest is not clearly erroneous.
*920 In conclusion, we hold that the trial court did not err by dismissing Patricia's petition to establish paternity because she is barred by IC XX-XX-X-X(b) from bringing such an action. The trial court also did not err by concluding that Patricia may not deny the presumption that Steven is R.P.D.'s father. We also hold that the trial court's judgment that the paternity petition was not in R.P.D.'s best interest is not clearly erroneous. Accordingly, Patricia, as R.P.D.'s next friend, is prohibited from bringing a paternity petition on R.P.D.'s behalf.
Affirmed.
BAILEY, J., and FRIEDLANDER, J., concur.
