How to set default value of variable in catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-17-2020 08:52 PM
HI All,
I have a catalog item with variable( sub-state) and when we submit the catalog a new record is created on the hardware table. I have created a onload catalog catalog client script, which sets the value of sub-state to available. when i open this record in the hardware table, the new choice is getting created rather than the old value being used. i have used the sys_is of the record in catalog script. .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-17-2020 09:40 PM
No the default value isn't working, as substate is depended on state and there is a reference qualifier on the sub-state variable.The catalog script is this
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setValue("substate","available_state");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-17-2020 09:59 PM
In Hardware table, do you have sub state field? if yes what are the choices?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-17-2020 10:28 PM
Yes the sub- state is a field on hardware table , which is getting populated from the catalog item variable .There are different choices depending upon the state.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-18-2020 07:10 AM
So in sub- state dictionary have u set the dependent on field to state in hardware table??
have you given dependent values to sub-state choices ?
And what is the new choice is getting created rather than the old value ? can u explain little bit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-19-2020 12:22 AM
yes on hardware table also the sub-state is depended on state.
yes the value is given .
the new choice is in blue colour same as that is given "Available" . when i try to update this record the value is set to the right choice and the new created choice desappers.