Auto populates value is not getting saved to catalog variable

sowmyaj
Giga Expert

Hi All,

I'm auto populating the serial number based on hostname and which is working fine on catalog task level but when I save the catalog task form, I see blank value on serial number

find_real_file.png

Before saving the form

find_real_file.png

After saving the form

find_real_file.pngfind_real_file.png

Any help will be appreciated.

Thanks,

sowmya

1 ACCEPTED SOLUTION

sowmyaj
Giga Expert

Field readonly feature was causing the issue.

 

Resolved the issue by setting value first and setting readonly to true.

View solution in original post

7 REPLIES 7

bernyalvarado
Mega Sage

Hi Sowmya,



Perhaps you have other scripts that are overwriting the serial number.



Thanks,


Berny


bernyalvarado
Mega Sage

Some thoughts that could be helpful:



a) validate client script (on Load, on Change, on Submit) on either the catalog item or the variable set that could be affecting the expected behavior


b) validate your business rules affecting the catalog task table


c) take a look in your system log (errors, warning and information) right after trying to save the form and see if you can identify a log entry that may indicate what could be wrong


d) try other scenarios that may bring light of what could be wrong: like... setting the value to a hard coded value, ...setting the value at an onLoad client script, etc...



Thanks,


Berny


Hi Berny,



I have checked the business rule,client script and catalog client script there is no track to find the serial number setting to empty on save/submit.


I have hardcoded the value and saved the form but no change.



Also I have changed the name of the variable for testing purpose. Earlier it was serial_number now I changed to something else for making sure that there shouldn't be any duplicate name. I know it shouldn't be a problem as the script is specific to catalog item but   tried for not miss anything.



Below is the track of log when I saved the form after the serial number is set with a value


find_real_file.png



Thanks,


sowmya


can you please share your script include code?


also make changes in client script. instead of giving newValue


try with


var check=g_form.getValue('hastname);


then pass "check" in ('sysparm_host_name',check)



in script include put the log while getting the sysparm_host_name.