MakeAndModelJS script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2022 10:32 PM
Hi All,
I am trying to understand what script include named as MakeAndModelJS do ? In comments, it says, it will pick the record from model table if model name is not not null (line no. 16).
I am looking for any documentation which elaborate the whole thing like how variable 'modelTable' is getting set here? What is model table? etc
Thanks in Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 12:59 AM
modelTable calls an internal java class to which we don't have access to. It effectively just returns the table name and validates that the table inputted as part of the fromNames() function is a valid one. Any table that extends cmdb_model is usable. You can even use short terms for the name (i.e "hardware" rather than "cmdb_hardware_product_model").
You then have a series of functions to return information. It's a better way than doing a glide query on the table and potentially creating duplicate models.
If you've used the new Integration Hub ETL application for robust CMDB import, that leverages this script include for reconciling model information.
getManufacturerGlideRecord ()
getManufacturerName ()
getManufacturerSysID ()
getModelGlideRecord ()
getModelName ()
getModelNameSysID ()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We are working in a domain-separated instance where manufacturers exist both in the global domain and in child domains. Our objective is to standardize and maintain manufacturers/models in the global domain wherever possible.
Currently, our transform map uses the out-of-the-box “Make and Model” Script Include. From our observation, the lookup logic searches models using:
- Model Name
- Manufacturer
However, in a domain-separated environment, it appears to prioritize the child-domain manufacturer and does not properly resolve existing global models.
Because of this:
- A global model may already exist.
- The transform still fails to find it.
- A duplicate model gets created in the child domain.
To address the global manufacturer issue on the model, we implemented a Business Rule that updates the manufacturer to the global manufacturer whenever a new model is inserted.
However, this introduced another issue:
- The next transform execution still searches using the child-domain manufacturer.
- The lookup fails again.
- Another duplicate is created.
- The Business Rule updates it again.
- This cycle repeats.
As a workaround, we implemented custom logic in the transform map:
- First, attempt lookup using a custom GlideRecord query to explicitly check for a matching global model.
- If not found, create the model using the Script Include.
- Before insert/save, update the manufacturer reference to the global manufacturer.
This approach breaks the duplicate loop because future transform runs can successfully match the global model.
We wanted to check with the community:
- Has anyone faced a similar issue in a domain-separated environment?
- Is there a cleaner or more scalable approach to handling global manufacturer/model standardization?
- Would overriding/extending the OOB Make and Model logic be a better design than using transform-map-level workarounds?
Any guidance or best practices would be appreciated.
Thanks!