Fix script giving an unexpected result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2024 11:19 PM
Hi All,
Before I had run the following script on alphabet field where the requirement was when I select others in alphabet field the existing value should populate on other alphabet field.
var grTable = new GlideRecord('table_name'); grTable.addEncodedQuery('filter');//use the filter in list view and copy the query. grTable.query(); while (grTable.next()) { if (grTable.caste_field) { grTable.other_caste = grTable.caste_field; grTable.update(); } }
It was working fine but few days back I notice the mentioned fields are full of with value as others instead of the existing value. Till now I am not able to find out how it is happened .
Is it possible to get previous record as it was before or any other solution to get the expected result ?
For more info also refer to :- Solved: populate exiting data in other field and keep cast... - ServiceNow Community
Thank YOU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 12:12 AM
Hi @1_DipikaD , previous replies form @Harsh_Deep and @Eshwar Reddy should work as well. just to add you might wanna check the the type of both field they should be same, if not then try stringifying the data using .toString() as suggested by @Eshwar Reddy .
Thanks,
let me now if any of the solution worked.