13
Views
1
Comments
Solved
[Environment Identification] Returning Unknown Environment
Forge component by Tiago Bernardo
1
Published on 11 Mar 2019
Application Type
Traditional Web

Hi
I downloaded your component off of forge - set the 3char field to DEV and TST but it still fails and returns a value for an unknown environment

Am I maybe overlooking something?


Rank: #24592
Solution

Hi, so your code and examples say to use DEV, TST and PRD - and your code checks for that. But when you pass the variable in, it changes the value you assign to lower case (DEV -> dev, TST -> tst and PRD -> prd) - but your code checks for Upper Case, and is case sensitive, which is why it returned false every time.

Hope that helps you or someone else

As for the solution,
Just change the Assign as follows in each of the above calls:

Removing the top line and replacing it with the lower line - and it'll work perfectly