Let $V_W$ and $V_Y$ be Euclidean vector spaces and let $V_Z \equiv L(V_W \rightarrow V_Y)$. Given a Wiener process $W$ on $V_W$, with natural filtration $\{\mathscr{I}_t\}$, and a $\mathscr{I}_T$-measurable random variable $U$ in $V_Y$, we seek adapted processes $(Y, Z)$ in $V_Y \times V_Z$ satisfying the SDE $U = Y(t) + \int_{(t,T\rbrack}ZdW - \int_{(t, T\rbrack} \Gamma(Y, ZZ^\ast) ds/2, 0 \leq t \leq T,$ under local Lipschitz and convexity conditions on the map $(y, A) \rightarrow \Gamma(y, A)$. These conditions apply in particular in the case $\Gamma(y, A) = \sum\Gamma^i_{jk}(y)A^{jk}$, where $\Gamma$ is a linear connection on $V_Y$ whose Christoffel symbols $\Gamma^i_{jk}$ are bounded and Lipschitz, and $\Gamma$ has certain convexity properties. In that case the solution $Y$ above is known as a $\Gamma$-martingale with terminal value $U$. The solution $(Y, Z)$ is constructed explicitly using the Pardoux-Peng theory of backwards SDE's. Applications include the Dirichlet problem and the heat equation for harmonic mappings, and other PDE's.