• Sébastien Van Cutsem 8
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
We would like to avoid to hardcode value in an apex class and use "environment variable". Is the use of custom settings the right way to do that ? 

Today I created a custom settings containing 2 fields, an url and a authorization token. The values are differents from one sandbox to another, so I create one data set for each of my sandbox (dev-int-uat-prod). Now my problem is to know in wich sandbox am I ? To retrieve the right values from my custom setting and of course I don't want to hardcode it. I used UserInfo.getUserName().substringAfterLast('@').substringAfterLast('.') to retrieve the sandbox name but for production this code doesn't work, so can anyone help me on the best way to do that ?

Thanks in advance for your answers and your help.
Today we do not have a release magament process for SFDC releases. I read a lot of articles on the subject but I don't find the best way. There is a lot of tools to do that : Flosum, AutoRABIT, Copado, CloudMax, sfOpticon, Force.com Migration Tool... 
We think to use the Migration tool with SVN and the dataloader to automate all the process and make Continuous Integration with Jenkins. The idea is that we would like to have :
- a sandbox for each developper 
- a sandbox (QA-Integration) to validate the code (SF best practices convention, naming convention,...) 
- a sandbox (UAT) for users tests
- a sandbox (staging) to validate migration to production 
- poduction
What we want to avoid is to take too much time for the prod deployment, found errors in the last step (UAT-staging), found dirty code in another environement than development and we would like to easily roll-back, compare environment, rebase an environment... We think that with the migration tool and svn we can achieve it without encountering too many difficulties but I want to be sure before I implement all the process. So has someone already implemented a similar process in his organization ? Has someone scripts exemple ? If not what do you suggest as a proper process for managing SFDC releases according to our needs ?

Thanks in advance for your answers en your help.
We would like to avoid to hardcode value in an apex class and use "environment variable". Is the use of custom settings the right way to do that ? 

Today I created a custom settings containing 2 fields, an url and a authorization token. The values are differents from one sandbox to another, so I create one data set for each of my sandbox (dev-int-uat-prod). Now my problem is to know in wich sandbox am I ? To retrieve the right values from my custom setting and of course I don't want to hardcode it. I used UserInfo.getUserName().substringAfterLast('@').substringAfterLast('.') to retrieve the sandbox name but for production this code doesn't work, so can anyone help me on the best way to do that ?

Thanks in advance for your answers and your help.