Worldwide developers face this that they have to write longer and longer Table Level Scripts to make business logic work and a single issue will force them to create multiple Component files again and again to modify the TLS.
I wonder if anyone knows there is a way to avoid this nuisance by using simple Java Script file instead of the Table Level Scripts.
For this we need to create a new Key in Registry of Current CRM.
Have a look at below steps:
1. Go to Registry editor and open the registry for current CRM installed on your System.
2. Most Probably you will find this at My Computer -> HKEY_LOCAL_MACHINE -> Software->eWare->Config
3. Select the Instance name of your CRM.
4. Right Click on Instance Name and click on New -> String Value
5. Put the Name of key as “ScriptCommonFunctions” and Save.
6. Double click on the newly created Key and it will open an editor.
7. Put the path of JS file here. It is required that this JS file should be in your CustomPages folder. For Example if you’re Custom Pages resides at C:/Program Files/Sage/CRM/
Then your new folder for JS file should reside in Custom Pages.
My JS files Name is “SampleJSTLS.js” and it resides in folder name “SKIPTLS” which is in Custom pages folder. So for the Key “ScriptCommonFunctions”, I will put the value as “SKIPTLS SampleJSTLS.js” and click on OK.
8. Now what we have to do is just define all the methods in this JS file and from TLS we just need to call them.
The benefit of this is if any changes are required then we need not to change in CRM which will need to create a new version of Component file. Instead of that just do the changes in the JS file which is much easier to deploy at client end.
Hope this helps.