Question

I'm writing the code in @Formula which will display different messages based on current stage of system. Stage determined by value in number field currStage, its value changes by lotus script and has range from 1 to 10. Everything works except when it get value 10, it displays wrong text, "text 1 " and displays number 0 after this. What's wrong with it?

value1:="text 1 ";
value2:="text 2 ";
value3:="text 3 ";
value4:="text 4 ";
value5:="text 5 ";
value6:="text 6 ";
value7:="text 7 ";
value10:="text";

optionList := value1:value2:value3:value4:value5:value6:value7:value10;
aliasList := "1":"2":"3":"4":"5":"6":"7":"10";
@ReplaceSubstring(@Text(currStage); aliasList; optionList)
Was it helpful?

Solution

Use @Replace instead and it will work.

@ReplaceSubstring replaces every substring. In case of "10" it starts looking for all elements in alias list and finds a "1". It gets replaces with "text 1 " and "0" stays so that you get as result "text 1 0".

@Replace replaces text only if whole string is equal to an element of alias list.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top