A method for the in-situ formation of a compound of formula (V) from pipecolic acid, wherein the in-situ method takes place in the presence of a solvent, wherein the solvent is an organic solvent having a boiling point ranging from about 50°C to about 160°C, water, or a mixture thereof, wherein the method comprises: (a) reacting pipecolic acid with an acid chloride of formula (Ia) in the presence of a base, or reacting pipecolic acid with an acid anhydride of formula (Ib), optionally in the presence of a base, to form a compound of formula (II), (b) reacting the compound of formula (II) with a compound of formula (III) to form a compound of formula (IV), (c) reacting the compound of formula (IV) with an ammonium source to form a compound of formula (V), wherein R 1 , R 2 and R 3 together with the carbon atom to which they are attached form a hydrocarbon group optionally comprising up to 3 heteroatoms independently selected from O, S, N and F; the phenyl group of the compounds of formulas (III), (IV) and (V) is substituted with n R 4 substituents wherein n is zero, one, two, three, four, or five; each R 4 is independently selected from halogen, cyano, nitro, C 1 -C 6 alkyl optionally comprising up to 5 halogen atoms, C 2 -C 6 alkenyl, C 1 -C 6 alkoxy optionally comprising up to 3 halogen atoms, C 1 -C 3 -alkoxy-C 1 -C 3 -alkyl, and C 3 -C 7 cycloalkyl; B + is a cation provided by the base; and X is a halogen. (a) reacting pipecolic acid with an acid chloride of formula (Ia) in the presence of a base, or reacting pipecolic acid with an acid anhydride of formula (Ib), optionally in the presence of a base, to form a compound of formula (II), (b) reacting the compound of formula (II) with a compound of formula (III) to form a compound of formula (IV), (c) reacting the compound of formula (IV) with an ammonium source to form a compound of formula (V), wherein R 1 , R 2 and R 3 together with the carbon atom to which they are attached form a hydrocarbon group optionally comprising up to 3 heteroatoms independently selected from O, S, N and F; the phenyl group of the compounds of formulas (III), (IV) and (V) is substituted with n R 4 substituents wherein n is zero, one, two, three, four, or five; each R 4 is independently selected from halogen, cyano, nitro, C 1 -C 6 alkyl optionally comprising up to 5 halogen atoms, C 2 -C 6 alkenyl, C 1 -C 6 alkoxy optionally comprising up to 3 halogen atoms, C 1 -C 3 -alkoxy-C 1 -C 3 -alkyl, and C 3 -C 7 cycloalkyl; B + is a cation provided by the base; and X is a halogen. R 1 , R 2 and R 3 together with the carbon atom to which they are attached form a hydrocarbon group optionally comprising up to 3 heteroatoms independently selected from O, S, N and F; the phenyl group of the compounds of formulas (III), (IV) and (V) is substituted with n R 4 substituents wherein n is zero, one, two, three, four, or five; each R 4 is independently selected from halogen, cyano, nitro, C 1 -C 6 alkyl optionally comprising up to 5 halogen atoms, C 2 -C 6 alkenyl, C 1 -C 6 alkoxy optionally comprising up to 3 halogen atoms, C 1 -C 3 -alkoxy-C 1 -C 3 -alkyl, and C 3 -C 7 cycloalkyl; B + is a cation provided by the base; and X is a halogen. <EOS>