- 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:57 AM
Hi Maik,
I have removed it.
Here is the new script, and it is still not working.
var mft = current.variables.current_manufacturer_name;
var gr = new GlideRecord('core_company');
gr.addQuery('name', mft);
gr.query();
if (gr.next())
{
gr.name = current.variables.new_manufacturer_name;
gr.setWorkflow(false);
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 07:14 AM
Hi
can you please spend some more details about what exactly is not working?
What is your expectation and what is the result?
Do you get any meaningful error outputs? Is your workflow stuck anyhow?
Kind regards
Maik