As much as possible, I use the 'GetNext' eConnect procedures and methods to get the next document number in Dynamics. But it's not always available, and they're not available for all modules.
This article is a script that takes an alphanumber document number as a parameter and increments it.
For example, the current document number might be 'TSFR002345', this proc would increment that to 'TSFR002346'