onSubmit script error: TypeError: Cannot read properties of undefined (reading 'length'): function () { [native code] }

Corey Harris
Kilo Expert

Good afternoon,

I'm getting the following error on a client script that applies on catalog tasks when a technician clicks submit (update or close task) but I'm not exactly sure why or how to fix it:

find_real_file.png

 

Here's a copy of my script:

find_real_file.png

I commented out line 11 because I don't need those variables anymore and that's when the script broke but if I add that line back in, everything works fine.

I think it has something to do with lines 21 - 30 but not exactly sure.

Any help will be greatly appreciated!

 

Best regards,

 

cnharris

1 ACCEPTED SOLUTION

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Corey,

Check the value of cor_id. Put a log statement before line 22 (before the for loop).

From the error message, "variables[cor_id]" is null. This may happen when the value of cor_id is none of "system_access_removal", "gather_card_number_from_winpak", "inactivate_banktel_access", "remove_license_and_delete_user_in_adobe", "domain_admin", "hardware_return", nor "fulfillment_stage".

This may happen if display business rule is not setting the variable "gscratchpad.sc_task_correlation_id" correctly.

View solution in original post

6 REPLIES 6

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Corey,

Check the value of cor_id. Put a log statement before line 22 (before the for loop).

From the error message, "variables[cor_id]" is null. This may happen when the value of cor_id is none of "system_access_removal", "gather_card_number_from_winpak", "inactivate_banktel_access", "remove_license_and_delete_user_in_adobe", "domain_admin", "hardware_return", nor "fulfillment_stage".

This may happen if display business rule is not setting the variable "gscratchpad.sc_task_correlation_id" correctly.

Thanks Hitoshi for responding!

Yes sir, I was definitely getting a null value but luckily, the department decided that this catalog item was needed anymore so I just deactivated it. 

 

Best regards,

 

cnharris

Hello , how  Are  You ?

I got this error message when a try to close any update set . 

Thanks

Hi @Hitoshi Ozawa ,

In reference to this thread, I'm facing a very strange issue whenever I try to edit a workflow or create new workflow in Chrome browser (screenshot given below). However, I'm not facing this issue in Edge browser.

Could you please give me some insights.
This is happening in Chrome from yesterday - I did not instance level changes; version is Vancouver

subhadeep1618_0-1705393019950.png

 


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.