Set specific columns in reference fields from reference tables...

basantsoni
Kilo Guru

Hello Friends,

I've a requirement where we to set Asset Tag and Asset Serial Number into 2 reference variables in a catalog item. We have created 2 reference variables for reference table: cmdb_ci_computer.

In all the cases, it's taking only Asset Name not serial number or asset tag.

Do we have any idea like how when a user will select a record it'll asset tag into asset variable and serial number into serial number variable?

Thanks,

Basant

6 REPLIES 6

Mrudula6
Mega Guru

Hi Basant,



By default the reference field takes the value of the column name which has "display" column set to True. In cmdb_ci_computer, it is "Name".



Are Asset Tag and Serial number reference fields in your cmdb_ci_computer table? If not, you can fetch the value from cmdb_ci_computer table and set it in 2 string ype fields.


basantsoni
Kilo Guru

Hi Mrudula,s


thanks for your valuable reply on this.No, Asset Tag and Serial Number are not reference fields into CMDB Table. They are string fields.



Table

cmdb


Field

asset_tag


Type

string


Table

cmdb


Field

serial_number


Type

string




Basant


Hi Basant,



We cannot put string value into a reference field. Reference field needs "sys_id" of the record to populate. Do let me know in case you need help with populating those field without the reference field.



Please mark reply as helpful if it helped you


basantsoni
Kilo Guru

Do we have any other idea to set into reference fields where reference fields column display value is false.


thansk,


Basant