An Erub Tabshilin must be prepared before Yom Tob in situations where Yom Tob immediately precedes Shabbat, in order to allow one to cook on Yom Tob in preparation for Shabbat. The question arises concerning the case of a person who arrives in the synagogue for Minha on Ereb Yom Tob and realizes just then that he had forgotten to prepare an Erub Tabshilin. What options are available for such a person if he does not have time to return home and prepare the Erub Tabshilin before Yom Tob?
Some authorities rule that a person can prepare an Erub Tabshilin even in the synagogue by designating food products in the home as the Erub. For example, if he knows that there is a hardboiled egg in the refrigerator and a piece of bread in a certain place in the kitchen, he can stand in the synagogue and make the Erub declaration, stating that through such-and-such food items in such-and-such place it would be permissible to cook and make preparations on Yom Tob for Shabbat. Others, however, dispute this position, and claim that one cannot recite the Erub Tabshilin declaration, which begins with the words "Be’haden Eruba" ("With this Erub"), if the Erub is not present in front of him.
In light of this debate, Hacham Ovadia Yosef rules that a person in this situation should, if possible, call his wife and have her prepare the Erub Tabshilin. If a person has no one at home to prepare the Erub, then he may rely on the lenient position and prepare the Erub in the synagogue, as discussed. However, in order to satisfy all opinions, he should stipulate that if this preparation of the Erub is ineffective, then he relies on the Erub Tabshilin prepared by the local Rabbi. The "Gadol Ha’ir" (leader of the community) has the entire community in mind when he prepares his Erub Tabshilin, and thus one may rely upon the Rabbi’s Erub Tabshilin when the need arises. As such, if a person remembers upon arriving in the synagogue that he had not prepared an Erub Tabshilin, he should designate the Erub in the synagogue but stipulate that if this is ineffective then he relies on the Rabbi’s Erub.
Summary: In a situation where an Erub Tabshilin is required, one who remembers upon arriving in the synagogue that he had not prepared an Erub Tabshilin should designate the Erub in the synagogue, having in mind food products in his home that he designates as the Erub. He should then stipulate that if Halacha follows the view that this method is ineffective, then he relies on the Rabbi’s Erub. He may then cook on Yom Tov in preparation for Shabbat according to all opinions.