Is it possible to update the cmdb_ci field upon submission of the record producer form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2016 04:17 AM
We have a form where we need to update the cmdb_ci field based on what the user selected on their form, but only once they submit the form. Is this possible, or must the cmdb_ci field be updated on the form itself by the user? Ideally, once the user clicks submit, the cmdb_ci field would be updated in the background based on what they entered on the form.
Thanks for any help you can offer!
Scott

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2016 04:36 AM
Hi Scott,
Yes it is possible. You can use 'Script' block of record producer to perform this operation. Use 'producer' object to get the value on the form & assign it to cmdb_ci field.
BTW record producer is on which table?
Thanks,
Abhinandan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2016 10:24 AM
Hi Abhinandan,
The record producer is tied to our incident table.
At this point, I'd love to get something - anything - to appear in the cmdb_ci field. I've tried putting in several things in the script section but can't seem to get the format to take. Here is what I have tried:
current.cmdb_ci = 'test';
and
producer.cmdb_ci = 'test';
Are either of those correct, or am I doing something wrong entirely?
Thanks!
Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2016 10:31 AM
The script current.cmdb_ci is right.
But right hand side to equal sign is not right
cmdb_ci field on incident table is a reference field, so you have to give a sys_id
please write the below code, assuming the field name on the form where the user enters instance is cmdb_ci (or instance)
current.cmdb_ci = producer.cmdb_ci;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2016 10:38 AM
You will want to use the first one (current.cmdb_ci = 'sys_id'), but you will need to assign the sys_id of the cmdb item you want to attach to the new incident record. You may have to do a GlideRecord query to get the sys_id of the record you want, unless it is a static value or the user is choosing a CI in a reference field on the record producer form. If you need help generating that query just post what criteria you are using for choosing the CI.
-Steve