How to show Modal Popup message while Submitting a catalog item in Service portal?

prasannakumard
Tera Guru

Hi Team,

I'm new to Service portal. We have requirement like as follows:

In catalog form, If we fill all the fields and Submit the form, we need to show "Thank you" Pop up Model Message. If clicks on OK button it redirects to another page.

How can we achieve this in service portal. Where we need to write Submit button onclick functionality in service portal.

Please help on the same.

Thanks & Regards,

Prasanna Kumar

1 ACCEPTED SOLUTION

prasannakumard
Tera Guru

Thank you Sateesh Kumar,

I've fixed the issue/requirement with the following onSubmit script:

if (typeof spModal != 'undefined') {
spModal.open({
widget: 'wd-kb-article-popup',
widgetInput: {'sys_id': '5c08911d37f4af40548b53b543990ec2'},
title: 'SDS-China Submission',
buttons: [
{label:'OK', primary: true}
]
}).then(function(){
location.href="/sp?id=view_my_sds_tickets";
});
}

Now, after submit the page one popup is appear and we get the popup content from KB knowledge article and after clicking ok button, it redirects to another portal page.

Thanks & Regards,

Prasanna Kumar

View solution in original post

5 REPLIES 5

SatheeshKumar
Kilo Sage
Crete an on submit script and add the below code Var flag = 'false'; //Type appropriate comment here, and begin script below if (typeof spModal != 'undefined') { spModal.confirm("Can you confirm or deny this?").then(function(confirmed) { flag ='true'; }) } If (flag != 'true'){ return "false"! } Thanks, Satheesh .

prasannakumard
Tera Guru

Thank you Sateesh Kumar,

I've fixed the issue/requirement with the following onSubmit script:

if (typeof spModal != 'undefined') {
spModal.open({
widget: 'wd-kb-article-popup',
widgetInput: {'sys_id': '5c08911d37f4af40548b53b543990ec2'},
title: 'SDS-China Submission',
buttons: [
{label:'OK', primary: true}
]
}).then(function(){
location.href="/sp?id=view_my_sds_tickets";
});
}

Now, after submit the page one popup is appear and we get the popup content from KB knowledge article and after clicking ok button, it redirects to another portal page.

Thanks & Regards,

Prasanna Kumar

I have a newbie question. Where did you put the OnSubmit script? I thought we weren't allowed to use Catalog Client Scripts. I can't really think of another place where you'd put a script for an item. BTW: was it a catalog item or a record producer?

Thanks,

Richelle

Yes, It's a record producer/catalog item, where ever you required you can add this script in catalog client script only. It works for me.