Want to update the records in alm_asset table not to restrict when a record producer is submitted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 09:53 PM
Hi All,
we are having a record producer to insert the records in alm_asset table.
on the form there is a serial number filed. if we submit the form with the same serial number we need to update the record instead of restricting to insert.
need suggestions.
we tried with BR as below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 10:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 10:37 PM
@Community Alums
so user will update which target record?
your record producer has which all variables?
If serial number present on variable is present you want to update which fields on target table?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 10:39 PM
@Community Alums
something like this in record producer script
var grDupCheck = new GlideRecord('alm_asset');
grDupCheck.addQuery('serial_number', producer.serialNumberVariable).addOrCondition('asset_tag',producer.assetTagVariable);
grDupCheck.query();
if (grDupCheck.next()) {
grDupCheck.field1 = producer.variable1; // give the field and variable
grDupCheck.field2 = prodcucer.variable2; // give the field and variable
grDupCheck.update();
current.setAbortAction(true);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 10:38 PM
we are using the below script to insert the records.