16 lines
483 B
JavaScript

// (self.length != 0) ?
// self :
// (getContextData('2', 'cds.PRODUCT', '') == '-') ?
// self :
// getContextData('2', 'cds.PRODUCT', '')
getValue(self, self.length, getContextData('2', 'cds.PRODUCT', ''), $('dcp.TENCOR1/pcl/asdf', ''));
function getValue(value, length, product, recipe) {
if (recipe.toUpperCase() === 'asdf')
return 'asdf';
else if (length !== 0 || product === '-')
return value;
else
return product;
}