The CreatorCon Call for Content is officially open! Get started here.

Add a new line in description

kesha
Kilo Contributor

Hello,

I'm creating a catalog item request so that new items get added to our Product Catalog. I want to include the Manufacturer (Brand) and Model Number (Manufacturer Reference) in the description field of the Hardware Model record, but it's not populating as required. The issues is that there's no line break and the Brand (Manufacturer) populates the Sys ID instead of the actual manufacturer name. Any input would be much appreciated 🙂

Current Display:

find_real_file.png

What it should actually look like:

find_real_file.png

Part of my Run Script (code highlighted in bold):

//Create new hw product model

  var gr = new GlideRecord('cmdb_hardware_product_model');

  gr.initialize();

  gr.manufacturer = current.variables.manufacturer; //Populates Manufacturer, Vendor fields

  gr.model_number = current.variables.model_number; //Populates Model number, Product ID fields

  gr.cost = current.variables.price; //Populates Cost, Price fields

  gr.name = current.variables.description+'('+current.variables.model_number+')'; //Populates Display Name field

  gr.asset_tracking_strategy = current.variables.asset_tracking_strategy; //Populates Asset Tracking Strategy fields

  gr.cmdb_model_category = current.variables.model_category; //Populates Model Categories field

  gr.comments = current.variables.additional_product_details; //Populates Comments field

  gr.description += "Brand: " + current.variables.manufacturer; //Populates Manufacturer in Description field

  gr.description += "\nManufacturer Reference: " + current.variables.model_number; //Populates Model Number in Description field

  var model_sysid = gr.insert();

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Did you try with break tags



gr.description += "Brand: " + current.variables.manufacturer; //Populates Manufacturer in Description field


  gr.description += "<br/>Manufacturer Reference: " + current.variables.model_number; //Populates Model Number in Description field


View solution in original post

5 REPLIES 5

kesha
Kilo Contributor

That worked perfectly...thank you so much!