Save user provided comments in custom table field in Portal.

Mad3
Tera Expert

Hello Community,

 

Could help on this!

 

As bigginer to ServiceNow, Developed a clickable button using spModal.open() method in portal.

When click button window is populating inside the window user should provide comments. I am facing difficulty in to store those comments in a server with respect to the record.

The User provided comments should update in table Record.

 

Thanks in Advance!

 
 

Popup-Window.PNG

 
 
 

 

 

HTML:

Mad3_0-1676023112828.png

Client Script:

 

c.reject = function(){
c.comments='';
spModal.open({
title:'Comments',
message:'Please provide comments here:',
input:true,
value:c.comments,
}).then(function(comments){
c.comments=comments;
})

}

 

5 REPLIES 5

4b0d3
Giga Guru

Best way is to go to the widgets table and query fields or look for similar widgets.  You have to send the data to the server-script who will input it in the worknote/comments , or custom table field.   

The work_note/comment fields are actually saved in the journal table and referenced to the record it's being saved.

Mad3
Tera Expert

Hi @4b0d3 ,

Thanks for reply!

 

Could you please explain with code  to store or update the user provided comments in custom table field through server script and client side script.

 

Regards,

Mad3

Arpitha2
Tera Contributor

Hi @Mad3 ,

Were you able to achieve this? I also have the exact same requirement and I tried multiple ways to achieve the same. But I failed everytime!

 

looking for help..

Hello @Arpitha2 ,

 

Sorry I couldn't get solve this yet. I can able to popup but provided comments not able to save in a table in related field. If you get solution can ping here.