- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 01:34 AM
Hi All,
I want to dot walk to map fields of "MS SQL Database" table which is a child table of CMDB CI.
There are few text fields "Server port, ucmdb model, Maintenance Window Info, Patch Group, Next refresh" which are child class specific. I tried using "source script" but no luck. Please suggest.
Source Script : target.ref_cmdb_ci_db_mssql_database.tcp_port = source.u_server_port;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2022 12:28 AM
Hi,
Please try with :
target.sys_class_name = 'cmdb_ci_db_mssql_database';
target.tcp_port = source.u_server_port;
I'd expect this to work.
if this is not working you can add "On after" script and do a glideRecord on the target table with "target.sys_id" and update the field like this, but that will trigger a second update so option 1 is preferred.
var gr=new GlideRecord('cmdb_ci_db_mssql_database');
if (gr.get(target.sys_id)) {
gr.tcp_port = source.u_server_port;
gr.update();
}
Regards
Arnaud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2022 12:28 AM
Hi,
Please try with :
target.sys_class_name = 'cmdb_ci_db_mssql_database';
target.tcp_port = source.u_server_port;
I'd expect this to work.
if this is not working you can add "On after" script and do a glideRecord on the target table with "target.sys_id" and update the field like this, but that will trigger a second update so option 1 is preferred.
var gr=new GlideRecord('cmdb_ci_db_mssql_database');
if (gr.get(target.sys_id)) {
gr.tcp_port = source.u_server_port;
gr.update();
}
Regards
Arnaud