- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2016 10:14 AM
Hey no worries happy to help! I was a newbie too 5.5 years ago. Your knowledge about the platform will come fast, it just there are several different ways to accomplish something and that often creates added confusion. Plus we all interpret and do things differently anyway, but like I said I prefer to put all the script together in one place to prevent hunting down the road for maintenance or enhancements.
In regards to inserting multiple exceptions, I thought of that too, but depending on your business process you may want multiple records. The only other scenario, which may not apply, is what if a row has both a bad model and a bad location, do you want 1 or 2 exception records? If 1 you could remove the field maps all together and put all this script in the main transform map record (click run script to expose it) and then use source.imported_field_name and target.target_record_field_name type syntax to manually map the values. You could set variables along the way to flag that an exception needs to be created and then at the end of your script check the variable and insert 1 record with all the exception text.
Your approach with a serial number reference field is what I was suggesting. Call it whatever makes sense but having a reference field that takes the user working the exception to the affected CI record is useful. My recommendation is to make the reference to the Configuration Item (cmdb_ci) table is better that way you can use this table to handle all types of CI exceptions not just printers, as your example code deals with.
Let me know if you have any further questions. Please mark any of these posts helpful or the correct answer to your question so others reading this thread can benefit.