Concept:
For any triangle,
\[
\overrightarrow{AB}
+
\overrightarrow{BC}
+
\overrightarrow{CA}
=
\vec 0.
\]
Squaring both sides is a powerful technique that generates a relation involving dot products.
Step 1: Use the vector identity of a closed triangle.
Since
\[
\overrightarrow{AB}
+\overrightarrow{BC}
+\overrightarrow{CA}
=
0,
\]
taking the square of both sides,
\[
(\overrightarrow{AB}
+\overrightarrow{BC}
+\overrightarrow{CA})^2
=
0.
\]
Expanding,
\[
AB^2+BC^2+CA^2
+
2(\overrightarrow{AB}\cdot\overrightarrow{BC}
+\overrightarrow{BC}\cdot\overrightarrow{CA}
+\overrightarrow{CA}\cdot\overrightarrow{AB})
=0.
\]
Step 2: Substitute the side lengths.
Given,
\[
AB=2,\qquad BC=3,\qquad CA=4.
\]
Therefore,
\[
AB^2+BC^2+CA^2
=
2^2+3^2+4^2.
\]
\[
=
4+9+16.
\]
\[
=29.
\]
Hence,
\[
29+2S=0,
\]
where
\[
S=
\overrightarrow{AB}\cdot\overrightarrow{BC}
+
\overrightarrow{BC}\cdot\overrightarrow{CA}
+
\overrightarrow{CA}\cdot\overrightarrow{AB}.
\]
Step 3: Solve for \(S\).
\[
2S=-29.
\]
\[
S=-\frac{29}{2}.
\]
Conclusion:
\[
\boxed{-\frac{29}{2}}
\]