Get your business online with free website builder (en)

How to Convert or Replace Characters from String by using CONVERTSTR Function in BC D365

Replace Characters from String by using CONVERTSTR Function:

(1) In this blog, we will get to know about the use of the CONVERTSTR function in BC D365. Replaces all characters in the source found in FromCharacters with the corresponding character in ToCharacters and returns the converted string.

(2) Note: The length of the FromCharacters parameter and the ToChars parameter must be the same, otherwise it returns an error. If the parameter FromCharacters or the parameter ToChars is empty, the source is returned unmodified. Both parameters are case-sensitive.

(3) Syntax of CONVERTSTR:

NewString := CONVERTSTR(String, FromCharacters, ToCharacters)

(4) Now let’s take an example and see the result. In this example, we replace lowercase letters with uppercase letters, as shown.

Replace Characters from String Code D365 BC
  • Message 1 is: Do you want to leave data without saving?
  • Message 2 is: Do You Want to Leave Data Without Saving?

(5) Remarks from Microsoft, as shown.

Microsoft remarks for CONVERTSTR Function

Creation of Inventory Setup in D365 BC
How to Copy String using COPYSTR Function in D365 BC
Finished Production Order in Business Central
Creation of Production BOM in Business Central
Auto creation of Item while entering Item Description in Purchase Line in D365 BC
Introduce updated desktop installable app– Microsoft Docs

Leave a Reply