Encryption OOB popup not visible in catalog item

rajibosss11
Tera Contributor

Hi, Can any one suggest this method is not popup OOb box with Encryption and Without encryption option while uploading the attachment

Widget Angle provide :spAttachmentUpload

Type : Service

 

function(spModal, $q, i18n) {
'use strict';
return {
uploadAttachments: function(attachmentHandler, files) {
if (!files || !files.length)
return;
if (!g_has_encryption_context) {
attachmentHandler.onFileSelect(files);
    alert('hello');
return;
}
var context = "";
var title = files.length > 1 ? i18n.getMessage("Encrypt attachments?") : i18n.getMessage("Encrypt attachment?");
spModal.open({
title: title,
shared: {files: files},
backdrop: 'static',
keyboard: false,
widget: 'encryption-context-picker',
buttons: [
{label: i18n.getMessage('Upload Without Encrypting'), value: "no"},
{label: i18n.getMessage('Upload and Encrypt'), primary: true, value: "yes"}
],
onSubmit: function() {
context = this.shared.context.value;
return $q(function(resolve, reject) {
resolve({status: "ok"});
});
}
}).then(function(clickedButton) {
if (clickedButton.value == "yes")
attachmentHandler.setEncryptionContext(context);
attachmentHandler.onFileSelect(files);
});
}
}
}

 

6 REPLIES 6

SD_Chandan
Kilo Sage

Hi @rajibosss11 
Could you please try below code

function(spModal, $q, i18n) {
'use strict';
return {
uploadAttachments: function(attachmentHandler, files) {
if (!files || !files.length)
return;
//if (!g_has_encryption_context) {
attachmentHandler.onFileSelect(files);
// alert('hello');
return;
// }
var context = "";
var title = files.length > 1 ? i18n.getMessage("Encrypt attachments?") : i18n.getMessage("Encrypt attachment?");
spModal.open({
title: title,
shared: {files: files},
backdrop: 'static',
keyboard: false,
widget: 'encryption-context-picker',
buttons: [
{label: i18n.getMessage('Upload Without Encrypting'), value: "no"},
{label: i18n.getMessage('Upload and Encrypt '), primary: true, value: "yes"}
],
onSubmit: function() {
context = this.shared.context.value;
return $q(function(resolve, reject) {
resolve({status: "ok"});
});
}
}).then(function(clickedButton) {
if (clickedButton.value == "yes")
attachmentHandler.setEncryptionContext(context);
attachmentHandler.onFileSelect(files);
});
}
}
}




Thank you
Chandan

Hi @SD_Chandan This not work it have some error Can you suggest how to get this OOB popup?

Thanks

Bass

Ankur Bawiskar
Tera Patron
Tera Patron

@rajibosss11 

what's your actual business requirement here?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

HI @Ankur Bawiskar , Default OOB Encryption option like with encryption or Without Encryption option is not visible in catalog item while uploading attachment i have tried with ITIL user role