- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2020 12:04 PM
We need to create several tables, references and add columns in various existing tables. We have multiple environments and would like to know how can we create a single script which we can run on all the environments to have same changes?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2020 12:53 PM
This are the params taken:
table name
display field name
internal field name
type
lenght
referenced table (or keep it empty"
default value
scope

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2020 12:20 PM
Hi TT,
yes we can. This is working example of mine :
SncTableEditor.createElement("x_189996_mail_auto_test_table", "Class", "sys_class_name", "sys_class_name", "80", "", "javascript:current.getTableName();", "global");
P.S. 1 - application, Field name, class name to be used, length, table, in which scope
Cheers,
Joro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2020 12:45 PM
Thank you!! need more info though. Where do you run this script and if you can pls give reference to documentation around it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2020 12:52 PM
I dont have any documentation for this . Posted the way to do it for reference column. I use it in background script but any server side javascript can execute it. It should be ran from global scope - if you need custom scope use wrapper with script include which is in global so you can use it.
For table - seen it once but cant remember . I know there is for dropping tables for sure 🙂
Cheers,
Joro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2020 12:49 PM
For reference type it should look like this:
SncTableEditor.createElement("fm_expense_line", "My reference3", "my_reference3", "reference", "32", "alm_asset", "alm_asset", "global");