GetValueListDisplayValue used in calculations

HI,
I try to get a value back in calculations method of a datasource by using application.getValueListDisplayValue.

Used code:

function show_incoterms() {
	if (incoterms) {    //{Number}
		return application.getValueListDisplayValue("incoterms2010",incoterms);
	}
	return null;
}

The valuelist “incoterms2010” looks like:

EXW|%%scopes.constants.LEVERING_INCOTERMS.exw%%
CFA|%%scopes.constants.LEVERING_INCOTERMS.cfa%%

etc.

and:

var LEVERING_INCOTERMS = {
	exw: 1,
	cfa: 2,

etc.

This doesn’t work!
But when the valuelist look like:

EXW (ophalen)|1
CFA (naar kweker / loods - ALLEEN over land)|2

etc.
It works fine. But I don’t want a code on 2 places. :?
How can I avoid this? What do I wrong?

Thanks al ready.

I can not tell why this does not work, though an alternative solution would be to
a) store the incoterm codes themself (e.g. “EXW”) instead of just a number 1,2,3…
b) use i18n functions to translate the code for the users into an explanation
That concept could be used for valuelists to support listboxes, too.

Advantage would be that you see the speaking codes in the database table, and can support users with other languages.

Regarding your initial problem, I could imagine that

EXW|%%scopes.constants.LEVERING_INCOTERMS.exw%%

does not work because the %%-replacement-mechanism does not work in that context.
Instead Servoy takes that string literally.

You could also use

EXW (ophalen)|EXW
CFA (naar kweker / loods - ALLEEN over land)|CFA

as then you do not have to remember what 1 and 2 stand for.

Thanks Bernd,
Unfortunaly less flexibel as how I wanted, but at least this works.

There is a case related to this.
https://support.servoy.com/browse/SVY-11103
Fixed in 8.1.4

Not sure if this is the the same problem you experience?