Shulchan Aruch Orach Chaim 551:17 says:
טוב ליזהר מלומר שהחיינו בין המצרים על פרי או על מלבוש אבל על פדיון הבן אומר ולא יחמיץ המצוה
It is good to avoid saying Shehechianu in the three weeks on a fruit or clothing, but on a Pidyon HaBen he says it and doesn't postpone the Mitzvah.
The Magein Avraham (s.v. ולא יחמץ המצוה) quotes the Maharil as saying also to not postpone the blessing. He distinguishes this from postponing saying the Shechiyanu on the fruit since the practice is to say the Shehechiyanu when first eating the fruit, not just when first seeing the fruit, so this isn't a postponement.
The Ramo adds that if the fruit won't be available after the three weeks (it will spoil) that one even says a Shehechiyanu and eats it. (The Taz and the Magein Avraham there both address the implication that you don't wait until Shabbos according to the opinions that you can say a Shehechiyanu on Shabbos during the three weeks).
So from all of this, the result is that doing something that creates the obligation of Shehechiyanu is avoided if possible, but if the cause of the Shehechiyanu cannot be avoided the blessing is said.
Rabbi Eliezer Melamed puts it all together here (emphasis added):
If a person chances upon a "mitvza" which necessitates the "shehecheyanu" blessing (for example, Brit Milah or Pidyon Haben), he recites the blessing. This is because it was not he that determined the time for the blessing; it was Heaven that granted him with such an opportunity at this time (Shulchan Arukh 551:17).
Likewise, if a person meets a good friend for the first time in thirty days or more, and he is happy to see him, he blesses "shehecheyanu," for if he does not bless immediately, he will lose the opportunity to bless. Similarly, "shehecheyanu" is recited by the father on the birth of a girl the first time he sees the newborn, for if he does not bless immediately he will forfeit the blessing (based on the Shulchan Arukh 225:1 and the Mishnah Berurah 223:2).