Share via


Use new IncStr parameter to change integers by more than 1 in string variables

Enabled for Public preview General availability
Admins, makers, marketers, or analysts, automatically Apr 1, 2025 Apr 1, 2025

Business value

The IncStr method on Text types lets you increase a positive number or decrease a negative number inside a string variable by 1. This method is useful when you handle iterations that involve number series. If you wanted to change the number by more than 1, you had to write extensive custom logic. To simplify these scenarios, the IncStr method now supports an optional increments parameter to change the number by more than 1.

Feature details

The new overload of the IncStr method supports increasing or decreasing a number in a string variable by any amount. With this method, you can increment number series or similar series by more than one position in a single step.

To decrease a positive number, use a try function to handle cases where the string can't decrease further. When you decrease a number, the method adds leading zeros as needed.

The following example shows how to increment the integer 99 in the AText string variable to 109 in one call by using the new IncStr method overload with an increment value of 10.

Increment integers in string variables by more than 1 using the new IncStr overload

Geographic areas

Visit the Explore Feature Geography report for Microsoft Azure areas where this feature is planned or available.

Language availability

Visit the Explore Feature Language report for information on this feature's availability.

Tell us what you think

Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the forum at https://aka.ms/bcideas.

Additional resources

Text.IncStr(Text, BigInteger) Method (docs)