
181 Cal.App.4th 10 (2010)
103 Cal.Rptr.3d 684
UDC-UNIVERSAL DEVELOPMENT, L.P., Cross-complainant and Respondent,
v.
CH2M HILL., Cross-defendant and Appellant.
No. H033610.
Court of Appeals of California, Sixth District.
January 15, 2010.
*13 Watt, Tieder, Hoffar & Fitzgerald, Bennett Lee, Ben Patrick and David R. Johnson for Cross-defendant and Appellant.
Robinson & Wood, Jon B. Zimmerman and Hugh F. Lennon for Cross-complaintant and Respondent.

OPINION
ELIA, J.
In this appeal CH2M Hill seeks review of a judgment on a cross-complaint brought by respondent UDC-Universal Development, L.P. (UDC), pursuant to an indemnity provision in the parties' contract. The judgment required CH2M Hill, which had denied UDC's tender of defense, to reimburse UDC for the costs of its defense in a third entity's lawsuit. CH2M Hill contends that (1) the parties' contract required no defense because CH2M Hill's negligence was not alleged in the third party's complaint or established in UDC's action; and (2) UDC's cross-complaint was barred because its contract with CH2M Hill was illegal. We find no error and affirm the judgment.
*14 CH2M Hill also seeks review of a postjudgment order under Code of Civil Procedure section 411.35, in which the court granted its motion for verification but denied its request for costs and attorney fees in the cross-action. We find no abuse of discretion in the court's application of the statute and will therefore affirm this order as well.

Background
Between July 1995 and February 1996 the parties entered into two contracts under which CH2M Hill would provide engineering and environmental planning services in connection with the development of a residential condominium complex called Village Hidalgo, later known as Valle Vista. UDC was the developer of the project. Among the provisions of the 1995 agreement was paragraph 20, which obligated CH2M Hill to indemnify UDC under certain conditions and to defend UDC against "any suit, action or demand" brought against UDC "on any claim or demand covered herein."
In October 2001 the homeowners association of Valle Vista (hereafter, the HOA) filed a first amended complaint against UDC (which by then was called Shea Homes) for property damage resulting from "defective conditions" at the project, due in part to negligent planning and design of open space and common areas. During the ensuing litigation the HOA submitted consultant reports describing the adverse effects of drainage problems at the site, as well as soil instability, erosion, settling, and other geotechnical concerns.
In November 2006 UDC cross-complained for indemnity against numerous subcontractors, eventually substituting CH2M Hill for one of its Roe defendants. In the first, second, and sixth causes of action for equitable, comparative, and express contractual indemnity, UDC tendered its defense against the HOA's action to all cross-defendants based on their contracts with UDC.
CH2M Hill answered the cross-complaint with a general denial and numerous affirmative defenses, thereby rejecting UDC's tender. UDC therefore paid for its own defense between January 3, 2007 (the date of tender by service of the amended cross-complaint), and January 23, 2008, when the HOA's lawsuit was dismissed pursuant to a settlement with the defendants. The September 2007 settlement encompassed UDC's cross-claims against all of the cross-defendants except CH2M Hill.
On September 25, 2007, CH2M Hill moved for summary judgment, asserting that (1) the lawsuit was barred by the applicable statute of limitations and (2) UDC's failure to be properly licensed rendered its contracts with CH2M Hill illegal and barred its claims against CH2M Hill. The *15 superior court denied CH2M Hill's motion, and on July 15, 2008, the cross-action proceeded to trial.
On July 28, 2008, before the matter was submitted to the jury, UDC moved for a directed verdict. UDC sought a ruling that CH2M Hill was liable for UDC's defense costs under its agreement to defend and indemnify UDC. One week earlier, the Supreme Court had issued its opinion in Crawford v. Weather Shield Mfg., Inc. (2008) 44 Cal.4th 541 [79 Cal.Rptr.3d 721, 187 P.3d 424] (Crawford), holding that a contractual indemnitor incurs a duty to defend the indemnitee as soon as the indemnitee tenders its defense to the indemnitor. The parties stipulated that the jury would determine the factual issues of negligence and breach of contract, followed by the trial court's application of the indemnity provisions in the parties' contract in light of Crawford.
The jury was given a special verdict form on which to record its findings as to whether any party had been negligent and whether CH2M Hill had breached its contract with UDC. On July 29, 2008, it unanimously found that CH2M Hill had not been negligent and had not breached the contract. The trial court then took up the issue of CH2M Hill's duty to defend UDC in light of the jury's finding that CH2M Hill had not been negligent. The court suggested that "it would be a meaningless duty to defend if it did not arise from an accusation or complaint of negligence arising from the work." CH2M Hill then raised the question of whether the duty exists if there has been no evidence of such a claim by the HOA. The trial court invited additional briefing on that issue, along with further written argument on the applicability or effect of Crawford.
At a hearing on September 15, 2008, UDC urged the court to apply Crawford by ruling that CH2M Hill owed UDC a defense upon its tender; CH2M Hill, on the other hand, argued that Crawford was distinguishable. According to CH2M Hill, the indemnity provision of the parties' contract was "exceptionally broad," the defense provision did not come into play absent a finding of negligence by CH2M Hill, and the negligence allegations in the underlying complaint did not target or implicate CH2M Hill.
The trial court adhered to its earlier view that the parties' contract called for a defense upon an allegation of "some negligence in the manner in which the work was conducted." It was only the duty to indemnify, the court explained, that depended on a finding of negligence. The court stated that a separate duty to defend must occur before the duty to indemnify arises. "[O]therwise, you wouldn't need the duty to defend. The duty to indemnify would include all costs associated with the defense of the lawsuit based upon the work of the subcontractor. So, you know, logically I don't understand how or why you would have a separate duty to defend unless it arose at the *16 time that the litigation was occurring as opposed to the duty to [indemnify]." The court further rejected CH2M Hill's argument that Crawford should not be applied retroactively.
The parties then discussed apportionment of costs and attorney fees for the present action. CH2M Hill asserted the right to recover costs as the prevailing party on UDC's allegations of breach of contract and negligence; UDC maintained that CH2M Hill had not prevailed on breach of the contractual obligation to defend UDC. The court deferred that issue pending further briefing.[1] On October 2, 2008, it entered an order and a judgment requiring CH2M Hill to reimburse UDC for the defense costs it had incurred in defending the HOA claims related to CH2M Hill's work. On November 19, 2008, CH2M Hill filed a timely notice of appeal from the judgment.
Meanwhile, shortly after entry of judgment CH2M Hill moved for verification of UDC's compliance with Code of Civil Procedure section 411.35. According to CH2M Hill, UDC had not filed a certificate of merit as required by that statute and therefore should be ordered to pay CH2M Hill its costs and fees in the cross-action. In opposition, UDC asserted that CH2M Hill had waived this claim, having raised it for the first time in the history of the parties' dispute. UDC further asserted that CH2M Hill was not entitled to verification because it had not obtained a "favorable conclusion" to the litigation, within the meaning of Code of Civil Procedure section 411.35. In any event, UDC argued, it had satisfied the purpose of the statute because it brought its case against CH2M Hill with a good faith and reasonable belief that the action was meritorious, based on the expert opinion of a licensed engineer in the field.
On November 20, 2008, the superior court entered its order granting the verification motion but denying CH2M Hill's request for attorney fees and costs. The court rejected UDC's waiver argument, but it concluded that UDC had "fully complied" with the prefiling requirements of Code of Civil Procedure section 411.35 and that good cause existed for filing the cross-complaint against CH2M Hill. Although UDC had not filed a certificate required by the statute, CH2M Hill had not shown additional fees or expenses resulting from that omission. CH2M Hill, having already filed its notice of appeal from the judgment, separately appealed from this postjudgment order.


*17 Discussion


A. The Judgment on the Cross-complaint


1. CH2M Hill's Duty to Defend

CH2M Hill's primary assertion of error is directed at the court's finding that CH2M Hill had a duty to defend UDC against the HOA's lawsuit. In CH2M Hill's view, the parties' contract called for a defense only when the underlying claims arose out of CH2M Hill's negligence, whereas here there was no negligence finding by the jury or even allegation in the underlying HOA complaint. CH2M Hill also contends that the court's ruling was inconsistent with the jury's determination that CH2M Hill had no duty to defend UDC. As for the trial court's reliance on Crawford, CH2M Hill argues that the case is distinguishable and in any event should not be applied retroactively. None of these contentions can succeed.
The argument that the court's ruling was inconsistent with the jury's verdict on the defense issue is based on a false premise, contrary to the procedural posture of the case. As noted earlier, the question of whether CH2M Hill had breached its duty to defend UDC was discussed before the matter was submitted to the jury, at the outset of a hearing on proposed jury instructions and other issues. The court set forth its understanding of the parties' agreement on these matters as follows: "First of all, we don't have a final form of the special verdict form at this point but the parties have agreed to submit a special verdict form based upon negligence and breach of contract and reserve to the court the application of the indemnity provisions to those findings by the jury. [¶] Is that a fair statement of what counsel have agreed to?" Counsel for both parties answered affirmatively. The court proposed to decide the indemnity issues after the jury returned its verdict, and neither party objected.
The special verdict form asked whether CH2M Hill had been negligent (and corollary questions if the answer was yes), whether any other person or entity had been negligent, and whether CH2M Hill had failed "to do something that the Contract between it and [UDC] required it to do." This last question, in CH2M Hill's view, called for a determination of the defense issue, on which evidence had already been presented. But the only such evidence CH2M Hill points to is evidence regarding negligence by CH2M Hill. The jury was not given evidence on the request for a defense and its refusal, nor was it ever asked specifically to consider whether CH2M Hill's refusal to defend UDC constituted a breach of the consulting agreement.
The single query whether CH2M Hill failed to "do something" it was required to do under its contract was so broad as to be meaningless without *18 further clarification for the jury. The jurors could not have been expected to examine all potential sources of breach without further guidance, nor would they have necessarily reasoned that no negligence by CH2M Hill meant no breach of its duty to defend. The focus of UDC's argument on both the negligence and breach of contract claims was not CH2M Hill's defense obligation, but its obligation to perform its work in a competent and professional manner.[2] Conversely, CH2M Hill's argument was confined to defending CH2M Hill's performance and refuting criticism of its work on the project. Its counsel summarized by telling the jury, "At the end of the day, at the end of this trial it comes down to a single question for all of you: Has UDC convinced you that CH2M Hill and [its civil engineer] were negligent." The instructions likewise stated the contract issue as whether CH2M Hill had "breached its contract by failing to perform its work in a professional manner." Clearly the duty to defend was not an issue presented to the jury through evidence, in closing arguments, in the court's instructions, or on the verdict form. Consequently, the jury's findings can in no conceivable way be interpreted to encompass the duty to defend, an issue that was purposely withheld from its deliberations.
CH2M Hill's argument is not only contrary to the record of the trial, it is inconsistent with its own statements when the issue was before the lower court. In its written and oral arguments CH2M Hill insisted that the parties' contract required no defense of UDC unless CH2M Hill was negligent. At the hearing CH2M Hill's attorney pointed out that CH2M Hill had prevailed on breach of contract and negligence. The court then asked, "You prevailed upon the negligence. You didn't prevail upon the breach of contract if the duty to defend . . . was breached by you; correct? [¶] [UDC's attorney]: That's our interpretation, Your Honor. [¶] THE COURT: Correct? [¶] [CH2M Hill's attorney]: Correct, Your Honor."
Thus, the record of all the superior court proceedings related to this issue convinces us that both the parties and the court understood that the duty to defend was a matter for the court to decide. That the court did so independently of the jury's verdict did not constitute error in itself. Whether it correctly interpreted the parties' contract and correctly applied Supreme Court authority are questions to which we turn next.
CH2M Hill contends that the contracts between the parties created a defense obligation only if a claim against UDC arose out of CH2M Hill's negligence. The pertinent provision was paragraph 20 of the 1995 consultant agreement, which stated: "Consultant [CH2M Hill] shall indemnify and hold Owner, Developer, and their respective officers, directors, employees and *19 agents free and harmless from and against any and all claims, liens, demands, damages, injuries, liabilities, losses and expenses of any kind, including reasonable fees of attorneys, accountants, appraisers and expert witnesses, to the extent they arise out of or are in any way connected with any negligent act or omission by Consultant, its agents, employees or guests, whether such claims, liens, demands, damages, losses or expenses are based upon a contract, or for personal injury, death or property damage or upon any other legal or equitable theory whatsoever. Consultant agrees, at his own expense and upon written request by Developer or Owner of the Subject Property, to defend any suit, action or demand brought against Developer or Owner on any claim or demand covered herein. Notwithstanding the above, Consultant shall not be required to indemnify Developer or Owner from loss or liability to the extent such loss or liability arises from the gross negligence or willful misconduct by Developer, Owner, or agents, servants or independent contractors who are directly responsible to Developer or Owner, or for defects in design furnished by such person." (Italics added.)
Focusing on the phrase "any claim or demand covered herein," CH2M Hill maintains that in order for a duty to defend to arise, there had to be at least an allegation by the HOA that its damages arose at least partially from negligence on the part of CH2M Hill. To determine the merit of this position requires an examination of Crawford, supra, 44 Cal.4th 541, on which the trial court based its ruling.
J.M. Peters Co. (JMP), the cross-complainant in Crawford, was a developer which retained cross-defendant Weather Shield to supply wood-framed windows for a residential construction project. Weather Shield promised "(1) `to indemnify and save [JMP] harmless against all claims for damages . . . loss, . . . and/or theft . . . growing out of the execution of [Weather Shield's] work,' and (2) `at [its] own expense to defend any suit or action brought against [JMP] founded upon the claim of such damage[,] . . . loss, . . . or theft.'" (Crawford, supra, 44 Cal.4th at pp. 547-548, some italics omitted.) When some of the homeowners in the development sued JMP, Weather Shield, and others for construction defects, JMP cross-complained against Weather Shield and other subcontractors, seeking indemnity and a defense. All parties except Weather Shield and another subcontractor settled. In the homeowners' action, the other subcontractor was found liable, but Weather Shield was not.
(1) The trial court in Crawford ruled that the jury's verdict released Weather Shield from any duty to indemnify JMP, but it had nonetheless had an obligation to defend JMP against the homeowners' action, "insofar as those claims concerned the windows supplied by Weather Shield, regardless of whether Weather Shield was ultimately found negligent." (Crawford, supra, *20 44 Cal.4th at p. 549.) Weather Shield (along with the other subcontrator) was therefore ordered to pay a portion of JMP's defense fees and the attorney fees JMP had incurred in prosecuting its cross-action. (Ibid.) Affirming the trial court ruling and majority opinion of the Court of Appeal, the Supreme Court construed the parties' agreement to require Weather Shield "to defend, from the outset, any suit against JMP insofar as that suit was `founded upon' claims alleging damage or loss arising from Weather Shield's negligent role in the . . . project." (Id. at p. 553.) In so holding, the court recognized the significance of Civil Code section 2778, which in subdivision 4 obligates a contractual indemnitor to provide a requested defense "in respect to the matters embraced by the indemnity. . . ." The defense obligation arose as soon as defense was tendered and did not depend on the outcome of the litigation; that is, the duty existed "even if it was later determined, as a result of this very litigation, that Weather Shield was not negligent." (44 Cal.4th at p. 553.)
CH2M Hill attempts to distinguish Crawford on the ground that there the homeowners expressly alleged negligence by Weather Shield, whereas here the HOA's complaint contained no such allegations of defective performance by CH2M Hill. This case, CH2M Hill contends, is more comparable to Mel Clayton Ford v. Ford Motor Co. (2002) 104 Cal.App.4th 46 [127 Cal.Rptr.2d 759], where the indemnity provision required the manufacturer to "defend and indemnify" the dealer against third party claims "`arising out of an occurrence caused solely by a "production defect"'" in a vehicle supplied to the dealer. (Id. at p. 49.) The appellate court held that the trial court had erred by reading into the contract a duty to defend the manufacturer whenever a third party complaint merely included a claim for product liability, without limiting the obligation as the contract specified. (Id. at pp. 54-55.) "Thus, in Mel Clayton Ford, it was not an allegations-versus-proof distinction that negated the duty to defend. Rather, given the word `solely' in the indemnity/defense clause there at issue, the crucial fact was that the suit for which a defense was sought included allegations other than those to which the manufacturer had limited its defense dutydesign or production defects attributable to the manufacturer itself." (Crawford, supra, 44 Cal.4th at p. 563.)
The contract at issue in this case, however, does not limit the scope of CH2M Hill's obligation as strictly as that of the parties in Mel Clayton Ford. The indemnity provision does not state that there must be an underlying claim of negligence specifically against CH2M Hill in order to trigger CH2M Hill's defense obligation. It calls for indemnification when claims against UDC "arise out of or are in any way connected with" a negligent act or omission by CH2M Hill. The duty to defend applied to any "suit, action or demand brought against [UDC] on any claim or demand covered herein."
*21 The clause under scrutiny here is comparable to the provision considered in Crawford, where Weather Shield promised to defend JMP in "`any suit or action brought against [JMP] founded upon'" a claim of damage "`growing out of the execution of [Weather Shield's] work.'" (Crawford, supra, 44 Cal.4th at pp. 547-548, italics omitted.) Even if "any claim or demand covered herein" is interpreted to refer back to the indemnity requirement, that clause is so broadly worded as to apply to claims "in any way connected with any negligent act or omission" by CH2M Hill "or upon any other legal or equitable theory whatsoever." The defense provision is thus not so dissimilar to that of Crawford as to justify departure from the guidance of the Legislature and the Supreme Court.
(2) We thus are unconvinced by CH2M Hill's assertion that the underlying plaintiff must have alleged negligence by the consultant in order for the consultant's defense obligation to arise. In a construction project involving multiple consultants and subcontractors, any of them might have been negligent. An indemnitee should not have to rely on the plaintiff to name a particular subcontractor or consultant in order to obtain a promised defense by the one the indemnitee believes is responsible for the plaintiff's damages. Here the HOA sufficiently alleged that Doe defendants 101 through 125 were "architects, engineers, and consultants . . . who provided design services to [UDC] in connection with the planning, design, specification, inspection, development and construction of the Project." UDC in turn named numerous cross-defendants and Roes, eventually substituting CH2M Hill as one of the Roes liable for the "negligent services" provided in the surveying, design, grading, testing, and inspection of the property on which the condominium homes were built. The "negligent act or omission" language limited CH2M Hill's indemnity liability to the scenario in which CH2M Hill was proven negligent. The duty to defend, however, arose when the cross-complaint attributed responsibility for the HOA's damages to CH2M Hill's deficient performance of its role in the project. Although the HOA complaint did not specifically identify each subcontractor or the details of each role in the project, its general description of the defects in the project implicated CH2M Hill's work. This was sufficient to trigger CH2M Hill's duty to defend.
CH2M Hill continues to argue that the jury's eventual "no negligence" finding rendered the entire indemnity clause, including the defense provision, inapplicable. The trial court properly rejected this position, emphasizing that the indemnity and defense clauses pertained to separate obligations. If "any claim or demand covered herein" refers back to claims and demands identified in the indemnity clause, it obviously cannot be premised on a proven "negligent act or omission" by CH2M Hill unless there is first a finding of such negligence. As the trial court pointed out, requiring such a determination would render meaningless the defense obligation and contravene Civil Code section 2778 and the Supreme Court's admonition that a duty to defend arises *22 out of an indemnity obligation as soon as the litigation commences and regardless of whether the indemnitor is ultimately found negligent.
(3) CH2M Hill maintains, however, that Crawford should not be applied retroactively. CH2M Hill acknowledges the general rule that case law "applies retroactively to all cases still open on direct review and to all events, regardless of whether such events predate or postdate announcement of the rule." (Ticor Title Ins. Co. v. Employers Ins. of Wausau (1995) 40 Cal.App.4th 1699, 1713, fn. 9 [48 Cal.Rptr.2d 368]; see also Newman v. Emerson Radio Corp. (1989) 48 Cal.3d 973, 983 [258 Cal.Rptr. 592, 772 P.2d 1059] [explaining when, in compelling circumstances, narrow exceptions override general rule of retroactivity in interests of fairness and public policy].) CH2M Hill nevertheless invokes the exception for situations in which the parties have reasonably relied on the previously existing state of the law. (Newman v. Emerson Radio Corp., supra, 48 Cal.3d at p. 983.) Here, CH2M Hill argues, it reasonably relied on Regan Roofing Co. v. Superior Court (1994) 24 Cal.App.4th 425 [29 Cal.Rptr.2d 413] (Regan Roofing) in denying tender. In making this argument CH2M Hill confronts a substantial hurdle, as our Supreme Court has repeatedly rejected claims that new case law should not be applied retroactively, even in the duty-to-defend context when one party asserts reliance on past judicial authority. (See, e.g., Waller v. Truck Ins. Exchange, Inc. (1995) 11 Cal.4th 1, 24-25 [44 Cal.Rptr.2d 370, 900 P.2d 619].)
Although we are directed to no evidence in the record that CH2M Hill actually relied on Regan Roofing in declining UDC's defense, we will assume that fact for purposes of expediency. CH2M Hill's unilateral reliance on Regan Roofing, however, did not justify its refusal of tender. That case involved summary adjudication of a duty to defend which was overturned as premature, as there had as yet been no determination of negligence by the subcontractors that would give rise to a duty to indemnify "and a related duty to defend." (Regan Roofing, supra, 24 Cal.App.4th at p. 436.) Only an "exemplar" subcontract had been submitted to the trial court in the motion. (Id. at p. 430.) Part of the appellate court's rationale concerned the "practical problems for an immediate or current duty to defend," given the 24 subcontractors involved in various areas or phases of the project. (Regan Roofing, supra, 24 Cal.App.4th at p. 437.) The court did not directly address the question of whether the duty to defend was a separate obligation from the provision requiring indemnification of damages paid, but appears to have assumed the two were interdependent. Here the superior court emphasized that the duty to defend is distinct from the duty to indemnify, a point reinforced in Crawford.
The Fourth District, Division One, itself later cautioned against uniform reliance on its Regan Roofing decision in subsequent indemnity situations: *23 "Contrary to [the indemnitor subcontractor's] argument, nothing we said in Regan Roofing . . . is inconsistent with the freedom of contract discussed in Continental Heller[ Corp. v. Amtech Mechanical Services, Inc. (1997) 53 Cal.App.4th 500 [61 Cal.Rptr.2d 668]]. In Regan Roofing we merely held that it was premature to decide whether a subcontractor could be required to contribute to the defense of a claim before either its fault had been established or any determination had been made that such a defense existed notwithstanding fault. We did not suggest that an agreement which required indemnity from a faultless indemnitor was in any manner improper or unusual." (Centex Golden Construction Co. v. Dale Tile Co. (2000) 78 Cal.App.4th 992, 997, fn. 1 [93 Cal.Rptr.2d 259].) The superior court recognized this procedural distinction in rejecting CH2M Hill's excuse.
In any event, we disagree with the premise of CH2M Hill's assertion that Crawford so "dramatically changed" previously established law that its retroactive application would "punish" and "severely prejudice" CH2M Hill and "hundreds" of other litigants. The Supreme Court itself does not appear to have regarded its decision as such a radical departure from existing law. Its conclusion resulted in substantial part from a careful examination of Civil Code section 2778, which, "unchanged since 1872, sets forth general rules for the interpretation of indemnity contracts, `unless a contrary intention appears.'" (Crawford, supra, 44 Cal.4th at p. 553, italics added.) Particularly relevant was subdivision 3 of section 2778, which "provides that a promise of indemnity against claims, demands, or liability `embraces the costs of defense against such claims, demands, or liability' insofar as such costs are incurred reasonably and in good faith. . . . Second, the section specifies that the indemnitor `is bound, on request of the [indemnitee], to defend actions or proceedings brought against the [indemnitee] in respect to the matters embraced by the indemnity,' though the indemnitee may choose to conduct the defense. (Id., subd. 4, italics added.)" (44 Cal.4th at p. 553, citation omitted.)
The application of Civil Code section 2778 to the JMP/Weather Shield contract led the Supreme Court to conclude that the claims "embraced by the indemnity" were those "alleging damage or loss arising from Weather Shield's negligent role in the . . . project." (Crawford, supra, 44 Cal.4th at p. 553.) However, even before Crawford, subdivision 4 of section 2778, fairly read, contemplated a defense by the indemnitor before resolution of the substantive issue of liability. Thus, any assumption by CH2M Hill that Regan Roofing represented established law at the time of the HOA's lawsuit was not reasonable. Moreover, contrary appellate authority had held that a finding of negligence was not required before the indemnitor's defense obligation was triggered. (See Continental Heller Corp. v. Amtech Mechanical Services, Inc., supra, 53 Cal.App.4th at p. 508 [affirming trial court determination that under indemnity agreement between the parties general contractor need not prove *24 fault in order to establish subcontractor's duty to defend and indemnify contractor for a loss that "`arises out of or is in any way connected with the performance of work under this Subcontract'"].)
(4) We thus see no reason not to adhere to the Crawford court's holding in this case. The contract between CH2M Hill and UDC called for a defense when any claim against UDC implicated CH2M Hill's performance of its role in the project. That defense obligation arose when the HOA alleged harm resulting from deficient work that was within the scope of the services for which UDC had retained CH2M Hill. The trial court did not err in ruling that CH2M Hill had a duty to defend UDC upon UDC's request.

2. Illegality of the Contract

CH2M Hill next renews the argument it raised in its summary judgment motion, that UDC's claims are barred because UDC lacked a "Class A" contractor's license when it entered into the contracts with CH2M Hill. On appeal it continues to rely on Vallejo Development Co. v. Beck Development Co. (1994) 24 Cal.App.4th 929 [29 Cal.Rptr.2d 669], where a company without any type of contractor's license whatsoever was barred from seeking compensation for its services on an improvement project. UDC points out that Vallejo Development was not concerned with whether a license of a particular class was sufficient to perform certain construction work; consequently, UDC argues, that case is not controlling here.
(5) Business and Professions Code section 7031, subdivision (a),[3] precludes actions to recover "compensation for the performance of any act or contract where a [contractor's] license is required," when brought by a person acting as a contractor without a license.[4] "The purpose of the licensing law is to protect the public from incompetence and dishonesty in those who provide building and construction services. [Citation.] The licensing requirements provide minimal assurance that all persons offering such services in California have the requisite skill and character, understand applicable local laws and codes, and know the rudiments of administering a contracting business. [Citations.] [¶] Section 7031 advances this purpose by withholding judicial aid from those who seek compensation for unlicensed contract work. The *25 obvious statutory intent is to discourage persons who have failed to comply with the licensing law from offering or providing their unlicensed services for pay." (Hydrotech Systems, Ltd. v. Oasis Waterpark (1991) 52 Cal.3d 988, 995 [277 Cal.Rptr. 517, 803 P.2d 370].) "Regardless of the equities, section 7031 bars all actions, however they are characterized, which effectively seek `compensation' for illegal unlicensed contract work. [Citation.] Thus, an unlicensed contractor cannot recover either for the agreed contract price or for the reasonable value of labor and materials. [Citations.]" (Id. at p. 997.)
In denying CH2M Hill's summary judgment motion the trial court reasoned that there was evidence raising "at the very least" a question of fact as to whether UDC possessed a class B license, which was sufficient to develop property with the use of subcontractors. The court also concluded that UDC's ability to pursue a claim for noncontractual indemnity precluded summary judgment. The focus of trial on UDC's cross-complaint was its allegation of negligence by CH2M Hill, not the licensing issue. At a hearing following the conclusion of testimony, however, CH2M Hill argued to the court that no evidence had been presented that UDC had a license, a fact that UDC had an affirmative burden to prove. The court regarded this position as an "ambush" and offered to reopen the case to permit evidence of UDC's license. CH2M Hill suggested as an alternative to admit the license as an exhibit, even though it intended to object. After the jury retired, UDC offered a document showing that it had a class B license. Counsel for CH2M Hill stated that the company's "only objection [was] as to submitting the exhibit now." CH2M Hill agreed, however, that if it was proper to reopen the evidence to admit the exhibit, then "that is what the evidence would show. [¶] Our past dispute on that exact issue preserved and set aside for the purposes of the stipulation."
Setting aside the vagueness of CH2M Hill's stipulation at this hearing, we find no error in the trial court's determination that UDC's claims were not barred by illegality of the parties' contracts. At the prior hearing on the summary judgment motion the court correctly pointed out that CH2M Hill had not moved for summary adjudication; consequently, it could not rule on individual causes of action but had to deny the motion in its entirety when any one claim withstood the grounds asserted in the motion. (See Jimenez v. Protective Life Ins. Co. (1992) 8 Cal.App.4th 528, 534 [10 Cal.Rptr.2d 326] [noting that courts may not grant summary adjudication when motion was only for summary judgment]; see also Slovensky v. Friedman (2006) 142 Cal.App.4th 1518, 1527 [49 Cal.Rptr.3d 60] [absent alternative motion for summary adjudication, defendant "must show conclusively that all of the plaintiff's causes of action or legal theories fail as a matter of law"]; cf. Barber v. Chang (2007) 151 Cal.App.4th 1456, 1469 [60 Cal.Rptr.3d 760] [where defendant failed to meet burden and did not alternatively move for summary adjudication on another ground, summary judgment was improper].)
*26 It is clear that section 7031, subdivision (a), bars an action when the plaintiff seeks to recover compensation for work performed by an unlicensed contractor. "The term `compensation' as used in the statute `denotes sums claimed as an agreed price, fee or percentage earned by performance, and also sums claimed as the reasonable value of work done under implied contract.' [Citation.]" (Davis Co. v. Superior Court (1969) 1 Cal.App.3d 156, 159 [81 Cal.Rptr. 453].) "Thus, causes of action that do not seek `the collection of compensation for the performance of any act or contract for which a license is required' are beyond the scope of Business and Professions Code section 7031." (Holland v. Morse Diesel Internat., Inc. (2001) 86 Cal.App.4th 1443, 1451 [104 Cal.Rptr.2d 239]; see also Davis Co. v. Superior Court, supra, 1 Cal.App.3d at p. 159 [unlicensed subcontractor's breach of warranty claim against seller of defective materials not within language and purpose of contractor licensing statutes].)
Here, UDC was not seeking compensation for its services, either directly or indirectly through artfully worded pleadings. Instead, it sought indemnity for the damages it had to pay the HOA due to alleged defects in engineering work for which UDC believed CH2M Hill was responsible. Accordingly, even if we were to agree with CH2M Hill that under section 7031 UDC's class B license was inadequate to operate as a developer of Valle Vista, that status did not impair its ability to pursue its claims for indemnity.[5] This conclusion is of no consequence when applied to the damages paid to the HOA for which UDC sought reimbursement; no indemnification of these amounts was required or ordered, since the jury found CH2M Hill not to have been responsible for any harm suffered by the HOA. But the procedural distinction we have identified clearly applies to UDC's claims for its defense costs in the HOA litigation following CH2M Hill's refusal of tender. As to these claims it is beyond question that UDC was not seeking compensation for contractor services. "The contractor's license statute cannot be used as a shield to avoid a just obligation. [Citation.] The courts will not impose penalties on a contractor for noncompliance with the licensing requirements other than that provided by the statute." (S & Q Construction Co. v. Palma Ceia Development Organization (1960) 179 Cal.App.2d 364, 367-368 [3 Cal.Rptr. 690].) Because UDC's cross-complaint included allegations that *27 withstood CH2M Hill's reliance on section 7031, the court properly rejected CH2M Hill's summary judgment motion.

B. The Verification Motion

(6) CH2M Hill next asserts error in the court's ruling on the motion for verification under Code of Civil Procedure section 411.35.[6] This statute requires counsel for a plaintiff or cross-complainant in an indemnity action against a professional engineer to file and serve a certificate declaring that "the attorney has reviewed the facts of the case, that the attorney has consulted with and received an opinion from at least one . . . professional engineer . . . who is licensed to practice and practices in this state or any other state, or who teaches at an accredited college or university and is licensed to practice in this state or any other state, in the same discipline as the defendant or cross-defendant and who the attorney reasonably believes is knowledgeable in the relevant issues involved in the particular action, and that the attorney has concluded on the basis of this review and consultation that there is reasonable and meritorious cause for the filing of this action. The person consulted may not be a party to the litigation. The person consulted shall render his or her opinion that the named defendant or cross-defendant was negligent or was not negligent in the performance of the applicable professional services." (§ 411.35, subd. (b)(1).)
Subdivision (g) of section 411.35 prescribes the consequences of failing to file the certificate: Such failure "shall be grounds for a demurrer pursuant to Section 430.10 or a motion to strike pursuant to Section 435."[7] Subdivision (h) of the statute, the provision on which CH2M Hill based its motion and request for attorney fees, states: "Upon the favorable conclusion of the litigation with respect to any party for whom a certificate of merit was filed or for whom a certificate of merit should have been filed pursuant to this section, the trial court may, upon the motion of a party or upon the court's own motion, verify compliance with this section, by requiring the attorney for the plaintiff or cross-complainant who was required by subdivision (b) to execute the certificate to reveal the name, address, and telephone number of the person or persons consulted with pursuant to subdivision (b) that were relied upon by the attorney in preparation of the certificate of merit. The name, address, and telephone number shall be disclosed to the trial judge in an in-camera proceeding at which the moving party shall not be present. If the trial judge finds there has been a failure to comply with this section, the *28 court may order a party, a party's attorney, or both, to pay any reasonable expenses, including attorney's fees, incurred by another party as a result of the failure to comply with this section." (§ 411.35, subd. (h).) The purpose of the statute is to "discourag[e] frivolous professional negligence suits against registered civil engineers" by imposing a sanction on the noncomplying plaintiff or cross-complainant. (Guinn v. Dotson (1994) 23 Cal.App.4th 262, 270 [28 Cal.Rptr.2d 409]; accord, Ponderosa Center Partners v. McClellan/Cruz/Gaylord & Associates (1996) 45 Cal.App.4th 913, 915 [53 Cal.Rptr.2d 64].)
(7) What is immediately apparent from the text of subdivision (h) of section 411.35 is the discretionary nature of the sanction for a failure to file the section 411.35, subdivision (b) certificate. The statute permits, but does not mandate, verification by directing the party to disclose identifying information about the consultant the attorney used; and if the court finds that the attorney failed to comply with section 411.35, it may order a party (or the party's attorney) to pay the attorney fees the other party incurred as a result of that noncompliance.
At the hearing on the motion the superior court expressly found that UDC had in fact obtained the required expert opinion before filing its cross-complaint, even though "they didn't have to do [that] in terms of duty to defend." The court acknowledged that UDC should have filed the certificate and failed to do so; but that failure had not caused CH2M Hill any "further expense of any kind." Accordingly, the court granted verification but denied the request for fees or other expenses.
CH2M Hill nevertheless contends that it was entitled to all of its attorney fees and costs in defending the cross-action and that the court's denial of the request was unjustified. CH2M Hill cites Korbel v. Chou (1994) 27 Cal.App.4th 1427 [33 Cal.Rptr.2d 190] in emphasizing that it obtained a favorable conclusion by the jury's verdict in the cross-action. CH2M Hill further suggests that the court misinterpreted section 411.35 and that it erred in determining that UDC had complied with the consultation requirement by submitting a declaration from its attorney attesting to such consultation.
None of these points advances CH2M Hill's claim of error. CH2M Hill simply did not establish that it had incurred expenses that were attributable to UDC's failure to file the statutory certificate. Although CH2M Hill concedes that an award of expenses under section 411.35 is discretionary, it offers only repeated assertions of error in lieu of a demonstration that the court's order was irrational or arbitrary. On the contrary, the court was well within its discretion to accept counsel's declaration describing UDC's consultation with *29 an expert, and to find no harm to CH2M Hill in the form of additional expenditures caused by the lack of a certificate. No abuse of discretion is shown.

Disposition
The judgment and the postjudgment verification order are affirmed. To the extent that it pertains to this appeal, UDC's motion for sanctions is denied.
Rushing, P. J., and Premo, J., concurred.
NOTES
[1]  The issues concerning prevailing party status and entitlement to fees and costs are addressed in the companion appeal, UDC-Universal Development, L.P. v. CH2M Hill (Jan. 22, 2010, H033862) (nonpub. opn.).
[2]  In its opening argument UDC's counsel explained to the jurors that they would not be asked to decide the negligence issue as it related to indemnification.
[3]  All further references to section 7031 are to the Business and Professions Code.
[4]  This provision states, "Except as provided in subdivision (e), no person engaged in the business or acting in the capacity of a contractor, may bring or maintain any action, or recover in law or equity in any action, in any court of this state for the collection of compensation for the performance of any act or contract where a license is required by this chapter without alleging that he or she was a duly licensed contractor at all times during the performance of that act or contract, regardless of the merits of the cause of action brought by the person, except that this prohibition shall not apply to contractors who are each individually licensed under this chapter but who fail to comply with Section 7029." (§ 7031, subd. (a).)
[5]  In our view, none of the indemnity causes of action was barred by section 7031, as in them UDC was not seeking "collection of compensation" for contractor services. In that respect the cross-action calls for treatment similar to the equitable indemnity claims deemed viable in Ranchwood Communities Limited Partnership v. Jim Beat Construction Co. (1996) 49 Cal.App.4th 1397 [57 Cal.Rptr.2d 386]. There the contractual indemnity claim was held to be precluded because it arose out of an illegal contract, but the claim of equitable indemnity was allowed to proceed. We depart from the Ranchwood majority's suggestion that a claim based on contractual indemnity necessarily implies illegality if brought by an unlicensed contractor. In that respect we agree with the concurring and dissenting opinion in that case. (See Ranchwood, supra, 49 Cal.App.4th at pp. 1423-1424 (conc. & dis. opn. of McIntyre, J.).)
[6]  All further references to section 411.35 are to the Code of Civil Procedure.
[7]  Here the superior court was aware that CH2M Hill had not availed itself of the opportunity to file a demurrer, as provided in section 411.35, subdivision (g). Rejecting UDC's waiver argument, however, the court agreed with CH2M Hill that the demurrer was not a prerequisite for a verification motion.
