Storing sys_id in system property

Sam Ogden
Tera Guru

Hi all,

I am trying to create a script on a record producer for incident to map answers from variables to set values in reference fields on the back end incident form.   I have the following in the script:

if (producer.inc_rel_to != ('test')){

    current.u_product.setDisplayValue(gs.getProperty('sn_customerservice.insurance_product_schemes'));

}

The system property is:

find_real_file.png

The u_product field is a reference to the Application Model (cmdb_application_product_model) table.

This is the product I am trying to set:

find_real_file.png

I know if I set the value of the system property to the sys_id of Insurance Product Schemes then it works if I remove the setDisplayValue from the script.   However I am going to have to do something similar a few more times in my script and do not want a load of system properties with just sys_ids in them as it is not user friendly.

Any help as to where I am going wrong will be greatly appreciated

Thanks

Sam

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Sam,



You're going about this in the right way - congratulations.



Have you tried changing the property to "CDL Insurance Product Schemes"? It looks like the value is missing "CDL".


View solution in original post

2 REPLIES 2

Chuck Tomasi
Tera Patron

Hi Sam,



You're going about this in the right way - congratulations.



Have you tried changing the property to "CDL Insurance Product Schemes"? It looks like the value is missing "CDL".


Hi Chuck,



All thanks to your TechNow episode 14 TechNow Episode 14 | Avoid Hard-coding - YouTube  



I thought it was going to be something simple.   I had been using the name field rather than display name field.



All working now



Thanks once again



Sam