Unable to update sys_user Name-Value Pairs field from Flow Designer Custom Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi All,
I have a catalog item where, on submission, I need to take the value of a catalog variable ("I request an exception until" (which is a date type field)) and update the Requested For user's u_sn_attributes field on the sys_user table. The field type is Name-Value Pairs, and I need to create/update as USBEndDate .
I'm calling a Script Include from a Flow Designer Custom Action to update the user record.
Error message from flow:
FAILED TRYING TO EXECUTE ON CONNECTION glide.5 (connpid=3146779): INSERT INTO sys_user
Can someone please help me on this?
Script include:
var RemovableMediaDeclarationHandler = Class.create();
RemovableMediaDeclarationHandler.prototype = {
initialize: function() {
},
updateUsbEndDate: function(current) {
var userInfo = current.request.requested_for;
var userGR = new GlideRecord('sys_user');
if (userGR.get(userInfo)) {
userGR.u_sn_attributes.USBEndDate = current.variables.i_request_an_exception;
userGR.update();
}
},
type: 'RemovableMediaDeclarationHandler'
};
Custom Flow Action script: