Weird behavior of Constants on Mendix Cloud

0
Hi,   Not sure if anyone has noticed similar issue on Mendix Cloud vs local environment but we are noticing strange behavior with constants on Mendix Cloud v4. So we have a button which has a conditional visibility based on property. So in the visibility we are showing it based on expression: ($currentObject/ContentType = @Project.TYPE_SINGLE_SPACE). TYPE_SINGLE_SPACE is a constant in the project with default value: Single Space. It is used in multiple places and everything works as expected. But for different button we have conditional visibility with expression: ($currentObject/ContentType = @Project.TYPE_TWO_SPACES) and TYPE_TWO_SPACES constant default value is: Multiple Spaces Here. As you see the only difference between the two constants is that one has a single space in for default value but the other has two spaces in the default value. Locally everything works as expected and the button is rendered during the correct stage. The problem is in the cloud with $currentObject/ContentType = @Project.TYPE_TWO_SPACES). This doesn’t work: $currentObject/ContentType = @Project.TYPE_TWO_SPACES This works: $currentObject/ContentType = ‘Multiple Spaces Here’   As you can see if we use the constant with identical default value our button isn’t rendered. But if we directly add the string to expressien then it works. And it is happening only for the constant with three words in it (multiple spaces). And the weirdes thing is that it is only happening in the cloud. Locally runing the constant with multiple spaces works as expected. Has anyone experienced something similar? What might be wrong there? We are using Mendix 8.12.1
asked
1 answers
3

Hi Karlis,

Because you are having this issue only in cloud, I think the constant value in cloud is different than your local host hence it is not working as expected. Please can you go to Environment >  Details > Model Options tab and search for your constant and make sure the value is correct? https://docs.mendix.com/developerportal/deploy/environments-details#model-options 

Constants values are not automatically updated if you just update them locally. Only in the first deployment they are defaulted to the values defined locally after that if you change constant value locally and commit then it will not be updated automatically in any Mendix cloud environment. You have to manually update the required constant values. 

 

Hope this helps!   

answered