- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 05:07 AM
Hi All,
I have a requirement where a custom field 'Row/Rack location' which extends from the 'cmdb_ci' table needs to be updated on 26 different classes. Currently a Transform map is configured on one target table - cmdb_ci_hardware where it updates the row/rack location field to only this target table.
The requirement is to update around 26 different classes. There is no such mapping exists on those 26 tables.
Is there a way to include more classes on 1 transform map? Can we built a scrip (OnBefore) to customize the mapping?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 06:53 AM
Yes you can. Try it out.
Create a property and store values (tables/classes)
example: incident,problem,change,sc_req_item // mention your classes here
var table = gs.getProperty("YOURPROPERTYNAME HERE").split(","); //this convert the comma separate string to array
for(var i=0; i<table.length; i++){ // this will iterate based on number of table
var gr = new GlideRecord(table[i]);
gr.newRecord();
gr.short_description = 'TEST';
gr.insert();
}
Regards,
JAS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 06:17 AM
Can I use a system property instead or something like this? Creating a table or something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 06:40 AM
Can I also refer a table in the OnBefore Transform script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 06:53 AM
Yes you can. Try it out.
Create a property and store values (tables/classes)
example: incident,problem,change,sc_req_item // mention your classes here
var table = gs.getProperty("YOURPROPERTYNAME HERE").split(","); //this convert the comma separate string to array
for(var i=0; i<table.length; i++){ // this will iterate based on number of table
var gr = new GlideRecord(table[i]);
gr.newRecord();
gr.short_description = 'TEST';
gr.insert();
}
Regards,
JAS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2022 06:15 AM