Concept:
A vector field is said to be solenoidal if its divergence is zero.
\[
\boxed{\nabla\cdot\vec{V}=0}
\]
where
\[
\vec{V}=P\hat{i}+Q\hat{j}+R\hat{k}.
\]
Then
\[
\nabla\cdot\vec{V}
=
\frac{\partial P}{\partial x}
+
\frac{\partial Q}{\partial y}
+
\frac{\partial R}{\partial z}.
\]
Step 1: Identify the components.
\[
P=x+3y,\qquad
Q=y-2z,\qquad
R=x+az.
\]
Step 2: Compute the divergence.
\[
\frac{\partial P}{\partial x}=1,
\]
\[
\frac{\partial Q}{\partial y}=1,
\]
\[
\frac{\partial R}{\partial z}=a.
\]
Hence,
\[
\nabla\cdot\vec{V}
=
1+1+a
=
a+2.
\]
Step 3: Apply the solenoidal condition.
Since
\[
\nabla\cdot\vec{V}=0,
\]
we get
\[
a+2=0.
\]
Therefore,
\[
\boxed{a=-2.}
\]
Hence, the correct option is
\[
\boxed{(C).}
\]