Forgot to say Yaleh Veyavo:
By Shacharis or Mincha: If one forgot to say Yaleh Veyavo by the day of Rosh Chodesh, either by Shacharis or by Mincha, then he must repeat Shemoneh Esrei. [This applies for all days of Rosh Chodesh, whether Rosh Chodesh is one day and whether Rosh Chodesh is two days.] If prior to finishing Shemoneh Esrei one remembered that he did not say Yaleh Veyavo, [then if he is holding prior to saying the name of Hashem in the concluding blessing of Visechezena then he should say it as soon as he remembers and continue afterwards from Visechezena. If however he remembered only after he already said Hashem’s name in the concluding blessing of Visechezenu then some Poskim rule he is to conclude the blessing with Lamdeini Chukecha and then go back and recite Yaleh Veyavo and then repeat from Visechezena.] If he remembered after concluding the blessing of Visechezena but prior to Modim then he is to say it there [and continue afterwards with Modim]. If however he only remembered after he already began saying Modim then he must return to Ritzei and recite from there with Yaleh Veyavo. If he only remembered after he already finished Shemoneh Esrei then he must return to the beginning of Shemoneh Esrei. [This applies even if he remembered after reciting the second Yehi Ratzon, prior to talking three steps.] If however he remembered prior to reading the second Yehi Ratzon then he is to return to Ritzei. [If he is accustomed to add prayers after the second Yehi Ratzon then if he remembers prior to concluding these prayers he is to return to Ritzei.]
In doubt if said Yaleh Veyavo by Shacharis or Mincha: If one is in doubt as to whether he recited Yaleh Veyavo in Shacharis or Mincha then some Poskim rule he fulfills his obligation and is not required to return to Ritzei or repeat Shemoneh Esrei. Others however rule that it has the same law as one who did not say Yaleh Veyavo and he must hence return to Ritzei or repeat Shemoneh Esrei. Practically one is to complete the Shemoneh Esrei and repeat Shemoneh Esrei again as a Nidavah.
If one remembered only after he already Davened Musaf: If one had already davened Musaf and only then realized he had forgotten to say Yaleh Viyavo in Shemoneh Esrei of Shacharis then he does not need to repeat Shemoneh Esrei.
 Rama ibid; M”B 422/2; Admur 294/7 regarding Veata Chonantanu
 M”B 422/5; 114/6; Biur Halacha “Belo Chasima”; Shalmei Tzibur; Shaareiy Teshuvah 114/6;
Other Opinions: Some Poskim leave this matter in question, as Admur makes no mention of it and perhaps saying Lamdeini Chukecha is considered an intentional interval of speech which requires one to repeat Shemoneh Esrei. [Ketzos Hashulchan 21 footnote 12]
 M”B 422/5
 Michaber ibid
The reason he must return to Ritzei: As the blessing of Ritzei was invalidated by the omission of Yaleh Veyavo and hence must be repeated from the beginning. [See M”B 422/5]
 M”B 422/9 in explanation of Michaber ibid
 Shaar Hatziyon 422/8 in name of Elya Raba
 Michaber ibid
 M”B 422/8
 Rama 422/1; Kol Bo 11; Darkei Moshe 422/1; Taz 422/1 rules that if he remembered to say Yaleh Veyavo in Shemoneh Esrei [prior to reaching Ritzei] and then later he is in doubt as to what he actually said, then he is not required to repeat Shemoneh Esrei as we assume he said it.
 M”A 422/4; Beis Yosef 422 argues on Kol Bo; Bach 422; Rokeiach in name of Yerushalmi [brought in M”A ibid]; Peri Chadash 422; Elya Raba 422/6; Mamar Mordechai 422/7; Birkeiy Yosef 422/3 in name of Mahriy Malko; Kesher Gudal 21/8; Shaareiy Teshuvah 422/4; Beis Oved 5; Chayeh Adam 24/44; Derech Hachaim 33/82; M”B 422/10 “so is the Halacha as majority, if not all, Achronim argue on the Rama and rule as above”; See Taz ibid that if he did not remember to say Yaleh Veyavo in Shemoneh Esrei before Ritzei then he must repeat Shemoneh Esrei. The Birkei Yosef ibid rules that even if he remembered he is required to repeat
 The reason: As everyone sees that the common wording is without Yaleh Veyavo and hence when in doubt one is to assume the common wording. [M”A ibid]
 Kneses Hagedola 422; Nesiv Hachaim 33/15; Kaf Hachaim 422/18 rules that one is to repeat the prayer as a Tnaiy that if he must repeat it then he is repeating it as an obligation and if he is not obligated to repeat it then it is a Tefilas Nedava.
 Admur 126/3; Rameh 25; M”A 126/3; Kneses Hagedola 422; Birkeiy Yosef 108/5 [however in Shiyureiy Bracha he retracted]; Mor Uketzia 422 [brought in M”B 422/4] rules that one is to repeat the prayer as a Tnaiy that if he must repeat it then he is repeating it as an obligation and if he is not obligated to repeat it then it is a Tefilas Nedava. The M”B ibid brings both opinions and concludes with the ruling of the Mor Uketzia ibid.
Other Poskim: Some Poskim rule that an individual who forgot Yaleh Veyavo must repeat Shacharis even if he remembers after Musaf. [Peri Chadash 126/3; Chida in Shiyurei Bracha 108/2; 126; Erech Hashulchan 108/4; Shalmei Tzibur 222; Zechor Leavraham Letter Reish; Shaareiy Teshuvah 108/12; 422/3; Beis Oved 6; Kaf Hachaim 108/15; 126/16; Opinions brought in M”B ibid] Thus if he remembered only after the time of Shacharis has passed then he is to Daven Mincha twice, as Tashlumin. The above Poskim argue on the above conclusion of the Rameh and Kneses Hagedola. The Chida in Birkeiy Yosef ruled that Safek Brachos Lihakel however he then found a Rashba which clearly implies like the Peri Chadash and hence in Shiyurei Bracha he retracted his ruling and concluded that one must repeat Shacharis. He states that if the Rameh and Kneses Hagedola would have seen this Teshuvah of the Rashba they too would have retracted their ruling.
 The reason: As in Musaf one mentioned Rosh Chodesh and hence there is no need to invalidate the Shacharis due to it lacking Rosh Chodesh. Now although this law was only applied to a Chazan who forgot Yaleh Veyavo in his repetition of Shacharis, nevertheless one should not be stringent Bedieved for a Yachid by a matter that we are lenient even Lechatchila for a Chazan. [Admur ibid; Rameh ibid]