how to set value for string field having choices using fix script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-28-2022 02:39 AM
I want to insert a record with fiscal year field value, on form it is choice field but in backend it's a string
tableRec = new GlideRecord('cost_plan');
tableRec.initialize();
tableRec.name = 'Test costplan4';
tableRec.task = 'ff80cc231bb3f89c2473eb19b04bcb43';
tableRec.u_fiscal_year = 'FY-22/23'; // if am giving direct choice value it is coming in blue color
OR
tableRec.u_fiscal_year = 'af36cf62dbad9c509a88b1b239961937'; //if am giving sys_id of (FY-22/23) then sys_id is coming in the field.
tableRec.insert();
What is the correct method to insert choice from choice list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hope you are doing good.
Did my reply answer your question?
š” If my response helped, please mark it as correct āļø and close the thread š ā this helps future readers find the solution faster! š
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
