How call server code from client controller in widget from portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 05:37 AM
Hi Team,
I am working on esc portal there is one add action drop down button on RITM form like below. when I will click on Access button then one dialog will appear with submit and cancel buttion
On the RITM form there is one field called return date so when I click on submit so in return date field now date field populate and comment should update.
for that I have written code in widget but when I clicking on submit button it is not performing any action.
Please find my code below
server script
Client controller ---
Please help me here when I click on submit button return data should populate with today date and comment should update.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 06:05 AM
are you able to pass control to server ?
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-31-2023 01:44 PM
You can use the c.server.get function from the client which will call the server script, you just want to make sure you define your action, otherwise it will run the whole server script.
This article explains it more - Get server data in widget client controller - ServiceNow Community