Populate the cost centre code into a different field based on selected cost centre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 01:33 AM
I've created a new field called 'Cost Centre Code' on one of my catalogue items:
What I want to do with this field is populate the 'code' from the cost centre (cmn_cost_center) table depending on what's selected in the 'Cost centre'
So far, I've written a catalogue client script but it doesn't seem to do anything:
If somebody could please let me know what I need to do, that would be much appreciated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 01:45 AM
Could you try putting alerts and confirm where its failing or not returning any result. Also why cost center code field looks read only? maybe try making the field not read only.
Please mark helpful/correct if you are ok!
Thanks,
Saji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 01:56 AM
Hi,
Canyou also share the SI that you have written. Also check what values are you getting in the result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 02:06 AM
You should write a OnChange Client script on change of cost center rather than onLoad. Then it will work. When you pass values to Script include variable should be sysparm_table and sysparm_sys_id
Variable should start with sysparm_