• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

GetEnvironment returning id instead of description

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GetEnvironment returning id instead of description

    in Version 3.2 I can get the Environment Description if i use getEnviroment() but in 4.2 instead of the description I get the Environment ID.

    example:

    var environment = parent.Portal.config.Runtime.getEnvironment();
    console.log(environment);

    In 3.2 the above line gives me the name "Herr's Web Development Portal", but in 4.2 I get 1001 which is the Environment id?
    How can i get the Environment description in 4.2?

  • #2
    Try this...

    Code:
    var getEnvironmentName = function(){
       var envId  = Valence.util.Helper.getEnvironment(),
           envStr = parent.Ext.getStore('Environments'),
           envRec = envStr.findRecord('envId',envId);
        
       if (envRec){
          return envRec.get('envName');
       }
       return 'Not Found';
    }
    
    getEnvironmentName();

    Comment


    • #3
      That worked, thanks for your help.

      Comment

      Working...
      X