Let $S$ be a scheme. Consider the category $\mathrm{Aff}_{/S}$ of schemes affine over $S$, by which I mean $S$-schemes $X$ such that the structure morphism $X \to S$ is affine. For simplicity, I'll also call those affine $S$-schemes (though they don't have to be affine as an absolute scheme!). Consider the inclusion functor $\mathrm{Aff}_{/S} \to \mathrm{Sch}_{/S}$. Does this have a left adjoint?
The question is motivated by the "absolute analogue". It's well-known for $S=\mathrm{Spec}(\Bbb Z)$ that a left adjoint to $\mathrm{Aff} \to \mathrm{Sch}$ exists and it is given by $X \mapsto \mathrm{Spec}(\Gamma(X,\mathcal O_X))$. The same construction works as long as $S$ is affine.
One naïve way one might try to do a similar thing in the general setting is to use the relative Spec. The relative Spec construction has a nice universal property, so that seems promising. The idea is to define a functor $\mathrm{Sch}_{/S} \to \mathrm{Aff}_{/S}$ by sending $X \xrightarrow{f} S$ to $\underline{\mathrm{Spec}}_S(f_* \mathcal O_X) \to S$. The problem with this is that $\underline{\mathrm{Spec}}_S(f_* \mathcal O_X)$ is not even defined, because for general $f$, there's no reason that $f_* \mathcal O_X$ is quasicoherent! (This is however true if $f$ is qcqs.) So that doesn't work. Of course, via the relative Spec functor, the category of affine $S$-schemes is anti-equivalent to the category of quasicoherent $\mathcal O_S$-algebras, so the question could be recast in terms of asking for a functor from $S$-schems to quasicoherent $\mathcal O_S$-algebras with certain properties. Certainly taking the pushforward of the structure sheaf gives us a canonical $\mathcal O_S$-algebra, that may however not be quasicoherent, as mentioned before. So I guess if there was a sufficiently canonical way to associate to each $\mathcal O_S$-algebra a quasicoherent $\mathcal O_S$-algebra, applying that to the pushforward of the structure sheaf and then taking the relative Spec would give us our desired functor. Actually, there are some situations where one can associate to some non-quasicoherent module a "canonical" quasicoherent module with a suitable universal property, see here. I don't see how that lemma is applicable in this situation, however.
One could of course try to use adjoint functor theorems, however the original motivation for the question was figuring out whether the inclusion $\mathrm{Aff}_{/S} \to \mathrm{Sch}_{/S}$ preserves limits. (Note that $\mathrm{Aff}_{/S}$ actually has all limits because the category of quasicoherent $\mathcal O_S$-algebras has all colimits.) That's of course asking less than the existence a left adjoint, but in practice exhibiting a left adjoint is often a good way to show that a functor preserves limits.