
208 N.W.2d 15 (1973)
James FUREY, Appellant,
v.
CRAWFORD COUNTY, Iowa, Appellee.
No. 55796.
Supreme Court of Iowa.
May 23, 1973.
*16 James Furey, pro se.
Thomas R. Eller, County Atty., Denison, for appellee.
Submitted to MOORE, C. J., and RAWLINGS, LeGRAND, REYNOLDSON and HARRIS, JJ.
REYNOLDSON, Justice.
Plaintiff attorney commenced a civil action against defendant Crawford County to recover compensation for services rendered by him as court-appointed counsel in two criminal cases. Trial court sustained defendant's motion to dismiss filed prior to answer. Plaintiff appeals and we affirm.
Plaintiff's petition included the following factual allegations: (1) he is an attorney at law; (2) pursuant to chapter 775, The Code, he was appointed to represent Lloyd Hansen in two criminal cases in Crawford District Court; (3) one of the criminal cases, No. 23217, was dismissed upon motion; (4) the other criminal case, No. 23218, was tried to a jury and is presently on appeal; (5) plaintiff is entitled to compensation for services rendered pursuant to the order appointing him counsel at public *17 expense; (6) he wrote a letter to Judge James P. Kelley asking for a preliminary indication of the amount of attorney fees to which the judge thought he was entitled and requesting an opportunity to make a record if plaintiff had objections to the indicated amount; (7) Judge Kelley without further action by plaintiff entered an order setting fees and expenses at $771.25 in No. 23218, which amount was unreasonably parsimonious. Plaintiff alleged the order was arbitrary and capricious, amounted to a taking of plaintiff's property without just compensation and without due process, and denied him his rights to equal protection. Plaintiff prayed Judge Kelley's order be held null and void and for judgment against Crawford County in the sum of $3,000 for services rendered in both criminal cases.
Defendant filed motion to dismiss asserting (1) the county had no standing to pay fees to plaintiff in absence of a court order; (2) under § 775.5, The Code, compensation is set by the court not the county; (3) a jury or a court sitting as a jury does not have the power to alter the court order setting attorney fees; and (4) plaintiff's petition did not state whether it was in equity or at law.
Plaintiff's sole ground for resistance to the motion was, "That any judgment rendered by this court would be an order made pursuant to Section 775.5 of the 1971 Code of Iowa."
Trial court sustained the motion to dismiss, reasoning that only the court and not Crawford County could determine the total fee and that plaintiff's petition contained no allegation the county had refused to pay the fee allowed by Judge Kelley. Trial court ruled the county could not pay plaintiff an amount exceeding the fee already fixed by the court, and noted with respect to the dismissed criminal charge the fee was yet to be determined.
On appeal two issues are presented to us for decision: (1) May an attorney appointed to represent an indigent criminal defendant seek review of a prior court order setting his fees by instituting an independent civil suit against the county? (2) Was the county's motion to dismiss sufficiently drawn to raise the issue?
I. We treat first the question whether an attorney may sue the county in an independent civil action to obtain a court determination of reasonable compensation pursuant to § 775.5, The Code. It is clear plaintiff's petition did not state a common-law cause of action in contract or quantum meruit. First, plaintiff rendered his services to the criminal defendant, not to the county. Second, had the petition permissibly stated a common-law action in assumpsit, then either party could have demanded a jury trial. See Art. I, § 9, Constitution of Iowa; rule 177, Rules of Civil Procedure. The concept that a jury rather than the court would determine the amount of reasonable compensation, would totally nullify the effect and intent of those words found in § 775.5, The Code, "to be decided in each case by the court." We cannot approve this result.
We find persuasive the language and rationale of the following dicta in Board of Com'rs v. Moore, 93 Ind.App. 180, 189, 166 N.E. 779, 782 (1929):
"It is provided by statute (section 2248, Burns' 1926) the judge before whom the trial is had shall have authority to appoint counsel, but the amount of compensation to such counsel shall be settled and allowed by the judge of the court from which the change of venue was first granted.
"If counsel appointed to defend should be permitted to file a formal complaint against the county and recover for the services rendered upon the theory of a contract to pay such sum as the services rendered were reasonably worth, then the above statute would be entirely nullified. His said action would be the common-law action of assumpsit; being a common-law action, a civil case, the *18 plaintiff would, under the provisions of section 20, art. 1, of our Constitution, be entitled to a trial by jury, and thus again would the provisions of said section 2248 be set aside, nullified. We hold that a suit by formal complaint against the county for the services rendered as upon a contract will not lie, and that the demurrer to the said complaint should for this reason have been sustained."
Moore was later specifically overruled on other grounds in Knox County Council v. State, 217 Ind. 493, 29 N.E.2d 405, 130 A.L.R. 1427 (1940). The Knox case is not inconsistent with the result we reach today, there being no indication the lawyers there involved could have brought an action against the county prior to having their fees allowed by the court. Similar persuasive language is found in Johnson & Douglas v. Superior Court, 2 Ariz.App. 407, 410, 409 P.2d 566, 569, vacated on other grounds, 101 Ariz. 373, 419 P.2d 730 (1966).
Having concluded plaintiff's petition did not state a common-law action upon which relief could be granted, we must determine whether § 775.5 authorizes a special, independent cause of action against the county which would afford plaintiff relief. A fair reading of § 775.5 and the related chapter 775 statutes in pari materia does not convince us such cause of action exists. It is apparent any proceeding to determine reasonable compensation for an attorney appointed to represent an indigent criminal defendant is ancillary to the principal criminal case.
Obviously the appropriate procedure is for the attorney to file an application or motion captioned in the criminal case, directed to the court, requesting the amount of reasonable compensation to be fixed and awarded. The attorney should attach to his motion an affidavit disclosing any payment he has or may receive on behalf of his client as required by § 775.6, The Code.
The procedure would be simplified, and a better record made for review, if the attorney would also attach a supporting affidavit itemizing time spent and stating facts relevant to the difficulty and importance of the issues involved in the case, the responsibility assumed, his experience and ability, and any other factors important in determining reasonable compensation. See In re Condemnation of Lands, 261 Iowa 146, 153 N.W.2d 706 (1967). Trial court should fix a time and place of hearing on the motion, and specify the notice to be given the county attorney.
The attorney can state no claim for fees against the county until a court order has been entered determining reasonable compensation. At this juncture we point out plaintiff's assertion (in reply) that a final judgment would satisfy the § 775.5 requirement of a court order does not comport with rule 119, R.C.P., defining an order as a direction of the court not included in a judgment or decree.
The conclusion we reach today is not inconsistent with our prior decisions holding court-appointed counsel may not, on direct appeal of the criminal case, secure review of the attorney fees allowed by trial court. See State v. Garrett, 183 N.W.2d 652 (Iowa 1971); State v. Salter, 162 N.W.2d 427 (Iowa 1968); State v. Schmidt, 259 Iowa 972, 145 N.W.2d 631 (1966). Those decisions in no way suggest an attorney might sue the county in an independent action in order to get a court determination of reasonable compensation. State v. Schmidt, supra, tacitly approved the trial court procedure we have outlined above.
Nor is our conclusion inconsistent with the many early cases upon which appellant relies, in which attorneys sued the county for fees for services rendered to criminal defendants. All the cases cited to us are distinguishable on the facts, issues, and statutes involved. We note virtually all those cases were decided when there was no discretion involved in setting fees, which were specifically set by statute. See *19 § 775.5, The Code, 1958, and its predecessors. Once the services were rendered the county was obligated to pay the statutory fee. Prior determination by the court was neither necessary nor proper.
In 1959 the legislature amended § 775.5 by vesting discretion in trial court to allow sums in addition to statutory trial fees if necessary in the interest of justice. Regular Session of the 58th General Assembly, Chapter 376, Section 1. Then in 1965 the legislature enacted the present § 775.5 placing determination of reasonable compensation totally within trial court's discretion, free from legislative strictures. Regular Session of the 61st General Assembly, Chapter 449, Section 1 ("An Act to eliminate statutory fees for court-appointed attorneys and allow the court to establish each fee in consideration of the services performed.").
Having decided that plaintiff's petition did not state a claim upon which the court could initially decide the amount of reasonable compensation, it follows, a fortiori, it did not state a claim upon which trial court could redetermine the amount of compensation already set by Judge Kelley. We hold trial court did not err in ruling the petition failed to state a claim upon which any relief could be granted.
However, in view of the procedural uncertainty apparent in the cases reaching us, we deem it necessary to indicate that the proper mode to obtain review of trial court's determination of reasonable compensation is to petition this court for an original writ of certiorari, alleging trial court exceeded its jurisdiction or otherwise acted illegally. Rule 306, R.C.P. The writ provides a very limited review of trial court's discretion, only to the extent of determining if there has been an abuse thereof. State v. District Court, 213 Iowa 822, 238 N.W. 290 (1931). See also State v. Holliday, 169 N.W.2d 768 (Iowa 1969).
II. We next turn to the issue of the sufficiency of the motion to dismiss. We need not repeat the many general rules relating to motions to dismiss, reviewed in Rick v. Boegel, 205 N.W.2d 713 (Iowa 1973). A rule applicable to the instant case, not involved in Rick, is when a doubtful pleading is attacked by motion before issue is joined or in answer, it will be resolved against the pleader. Bigelow v. Williams, 193 N.W.2d 521 (Iowa 1972). Here, plaintiff's petition was more than doubtful.
Although not a model of clarity, defendant's motion to dismiss did state specific grounds. The grounds stated are substantially those we rely on in division I of this opinion. Trial court did not err in sustaining the motion to dismiss on the grounds stated.
Affirmed.
