My Appscript has many TS_ID comparisons. Have I gone down the wrong path?

Hello,

Our project has been growing for over 20 years. There are a bunch of appscripts. The scripts have many hard coded comparisons with TS_ID values. The code works well but the problem is that when I port from my test environment to my production environment I have reads that determine which environment I'm in and then use an if statement to reveal the prod version of  TS_ID comparisons. Many of the scripts are thousands of lines.

The real power of the Project is its use of relational multi-selection fields. The code builds the content in the  fields with arrays related to the TS_ID's and manipulates the arrays from one to the other through push and pop code. So, users see a list of checkboxes that are available in one state. The select the items they have installed and click the transition, then those selected items move to the other list of check boxes. ( While I was in college every programming course had a linked list programming assignment. I hated the exercise and thought I would never use the logic..... Funny how the application we developed uses linked lists throughout. )

At this point in time we are thinking about creating a pre-prod environment. I don't want to create another set of hard coded comparisons.  I think the best way to create a pre prod environment would be to  remove all the hard coded comparisons and use the field names so the code is portable. I guess I would have to build my arrays but reading the selection items by name and grabbing their id's. This will be a big operation at this point in time because it's been in production for over 20 years.

Did I go down the wrong road with all of the TS_ID comparisons or is that normal?

Is there a way to clone the entire database and rename it and publish out to that for pre-prod?

Also, it's all in appscript. Is appscript going away? Should I convert to modscript if I attempt to rewrite the code?

Thanks in advance for any constructive criticism that you wish to share.

Regards,

Will

  • Will, 

    You can certainly clone the prod database and restore it to a pre-prod database.  You will want to clean it up by deleting things like notificationEvents and notificationmessages.  You will create the prod prod environment and endpoints and then redeploy all of process apps to preprod so that it does not start updating your prod environment.[1]

    AppScript is deprecated which means there will be no NEW features with it, but we do not expect it to go away.  However, there are ways now that you can use to avoid using TS_IDs.  ModScript may make it easier to build functions for manipulation of your multi-select values and ultimately it would be nice to have a clean way to do that manipulation.  But let's ask others how they deal with MS value manipulation.

    Davod