replace character in a field

hai all I want to replace a field for character in the middle

for example I have field that value ADO-M01 → so i want to replace character “-” to be “.”

so the final output should be ADO.M01

does navision could do that like in the .NET ?

how is it possible?

thanks for your answer :slight_smile:

Hi Stan,

If you want to substitute any instance af a given char with another, you can use the CONVERTSTR-command.
The syntax for that command is…
CONVERTSTR(String,FromChars,ToChars)

In your case, you would have to use it like this:
MyField := CONVERTSTR(MyField,’-’,’.’);
MODIFY();

Note!!!
This will change ANY instance of the char, so if in your case the ‘-’ can be present in other positions of the field, and they are not to be changed, then you can’t use CONVERTSTR.
If this is the case, then you have to do some more “advanced” string-gymnastics.
You’ll then need to identify the actual position of the char you want to change, and then by use of DELSTR and INSSTR do the actual replacement.

wow it works !!

thanks a lot :slight_smile: