This post is an explanation of how to use the internal Dynamics stored procedure taGetPaymentNumber, which gives you the next RM number available. We also share our own script that does essentially the same thing (but we recommend the Dynamics script)