California
Code of Civil Procedure CCP § 418.10
(a) A defendant, on or before the last day of his or her time to plead or within any further time that the court may for good cause allow, may serve and file a notice of motion for one or more of the following purposes:
(1) To quash service of summons on the ground of lack of jurisdiction of the court over him or her.
(2) To stay or dismiss the action on the ground of inconvenient forum.
(3) To dismiss the action pursuant to the applicable provisions of Chapter 1.5 (commencing with Section 583.110 ) of Title 8.
(b) The notice shall designate, as the time for making the motion, a date not more than 30 days after filing of the notice. The notice shall be served in the same manner, and at the same times, prescribed by subdivision (b) of Section 1005 . The service and filing of the notice shall extend the defendant’s time to plead until 15 days after service upon him or her of a written notice of entry of an order denying his or her motion, except that for good cause shown the court may extend the defendant’s time to plead for an additional period not exceeding 20 days.
(c) If the motion is denied by the trial court, the defendant, within 10 days after service upon him or her of a written notice of entry of an order of the court denying his or her motion, or within any further time not exceeding 20 days that the trial court may for good cause allow, and before pleading, may petition an appropriate reviewing court for a writ of mandate to require the trial court to enter its order quashing the service of summons or staying or dismissing the action. The defendant shall file or enter his or her responsive pleading in the trial court within the time prescribed by subdivision (b) unless, on or before the last day of the defendant’s time to plead, he or she serves upon the adverse party and files with the trial court a notice that he or she has petitioned for a writ of mandate. The service and filing of the notice shall extend the defendant’s time to plead until 10 days after service upon him or her of a written notice of the final judgment in the mandate proceeding. The time to plead may for good cause shown be extended by the trial court for an additional period not exceeding 20 days.
(d) No default may be entered against the defendant before expiration of his or her time to plead, and no motion under this section, or under Section 473 or 473.5 when joined with a motion under this section, or application to the court or stipulation of the parties for an extension of the time to plead, shall be deemed a general appearance by the defendant.
(e) A defendant or cross-defendant may make a motion under this section and simultaneously answer, demur, or move to strike the complaint or cross-complaint.
(1) Notwithstanding Section 1014 , no act by a party who makes a motion under this section, including filing an answer, demurrer, or motion to strike constitutes an appearance, unless the court denies the motion made under this section. If the court denies the motion made under this section, the defendant or cross-defendant is not deemed to have generally appeared until entry of the order denying the motion.
(2) If the motion made under this section is denied and the defendant or cross-defendant petitions for a writ of mandate pursuant to subdivision (c), the defendant or cross-defendant is not deemed to have generally appeared until the proceedings on the writ petition have finally concluded.
(3) Failure to make a motion under this section at the time of filing a demurrer or motion to strike constitutes a waiver of the issues of lack of personal jurisdiction, inadequacy of process, inadequacy of service of process, inconvenient forum, and delay in prosecution.