Quantcast
Channel: NAV/Navision Classic Client — mibuso.com
Viewing all articles
Browse latest Browse all 2239

Replace the TEXT Red with the TEXT Blue

$
0
0
These are the functions I have so far, but the word red will not convert to blue.

Custom Description - OnValidate()
//-- Validation for Custom Description
IF ("Custom Description" = UPPERCASE('RED')) THEN
fConvertCustomDescription("Custom Description", 'RED', 'BLUE');
IF ("Custom Description" = LOWERCASE('red')) THEN
fConvertCustomDescription("Custom Description", 'red', 'blue');

LOCAL fConvertCustomDescription(cDescription : Text[50];cRed : Text[50];cBlue : Text[50]) NewOutput : Text[50]
//-- fValidateCustomDescription
Pos := STRPOS(cDescription, cRed);
WHILE Pos > 0 DO //Original: WHILE Pos > 0 DO
BEGIN
cDescription := DELSTR(cDescription, Pos, STRLEN(cRed));
cDescription := INSSTR(cDescription, cBlue, Pos);
Pos := 0;
NewOutput := cDescription;
IF Pos = 0 THEN
EXIT(NewOutput);
END;

I tested it, it seems logically correct, but it won't convert the entered text red to blue.

Viewing all articles
Browse latest Browse all 2239

Trending Articles