Is there any best practice for designing forms in a test environment before migrating to the live?
We have developed our forms on a test environment, these currently use databases/web services etc which need to be amended when migrating to the live site. At the moment migrating the forms include copying the form within the test environment and amending all the settings and resources to live before copying the copied form to the live environment. Basically each form will only have either TEST or LIVE resources attached but not both. This is a bit of a nightmare migrating as resources etc need remapped after name changes etc etc.
Now the two methods I have come up with which maybe better are:
- -> Set a variable to configure the "environment" for the form and use an if statement to call specific environment resources.
Code: Select all
var environment = fields.ENVIRONMENT.value;
if (environment == 'TEST'){
//call test external resources
else{
//call live external resources
}
- -> Set a variable to configure the "environment" for the form but actually use this variable within the external resources.
Code: Select all
var environment = fields.ENVIRONMENT.value;
tables.DBTABLE.fetchtable;
resources.WEBSERVICE.call();
Thanks, I hope it makes sense. Just trying to plan more efficient forms for the future.