- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 06:18 AM
Dear all,
I created a catalog item to Create New or Update Existing record on the table name Company [core_company].
There are 3 variables:
- Create New or Update Existing - Multiple Choice
- Current Manufactory - reference to Company [core_company]
- New Manufactory - Single Line Test
Note that: the field that need to update/create new in theCompany [core_company] table call name.
I created the following workflow script to update/create new record somehow it is not working.
var mft = current.current_manufacturer_name; if (gr.next()) { |
I would appreciate your help.
Regards,
Hong
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 07:13 AM
Hello,
Please see my last reply, above.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 06:25 AM
Hello,
To get any variable name in workflow script, you'd need to use the format:
current.variables.variable_name
Please check your script for proper formatting and context.
As far as GlideRecord is concerned, here's the documentation to help you with that if you're still facing issues: https://developer.servicenow.com/dev.do#!/reference/api/paris/server/no-namespace/c_GlideRecordScope...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 06:27 AM
Let me try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 06:33 AM
Hi Allen,
No luck.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 06:40 AM
Hi,
My reply above was specifically about the incorrect usage of how you were trying to get the variables. Your format was not correct, what I'm saying is correct, in that regard.
As far as anything else, if your script in trying to run as that user, do they have appropriate "write" privileges? Are you testing this as yourself? As a specific user?
Also why do you have: current.setAbortAction(true); in your script?
These and other things are beyond just the question that you asked that we don't know anything about.
Please explain more fully what you were thinking and/or wanting to do, why that code is there, what else are you doing to assist this troubleshooting process? I see no troubleshooting logs, etc.
Simply writing back "no luck", is not helping us.
Sorry!
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!