service portal widget to update a record

raycallan
Giga Guru

Hi Community,

I have a requirement to add a widget to the service portal to allow a user to escalate an incident. This is my fist time working with widgets so I have difficulty passing values between the html template and the server script

if it is not already escalated

  • They will select a escalate reason from an sn-record-picker
  • Enter their comment in a multiline textarea
  • Submit their comments which will update the incident record

if it is escalated

  • hide the widget

3 issues i have

  1. I'm unable to get the html template to get the value of the u_escalated filed (true/false). it always sees a 'false' value (log shows [object Object])
  2. I'm unable to get the the value of the sn-record-picker, (log shows 'undefined' value')
  3. My recording is not updating (not getting to gr.update)

Here is screen caps of my code

Escalate_html.PNG

Escalate_server.PNGEscalate_client.PNG

This is the log

Escalate_log.PNG

Thanks Ray

11 REPLIES 11

Hi vikram_7

Is it just the escalate comments that are not updating the incident or are any of the fields updating?

Can you verify the the field names in the incident match the glide record?

Have you a field in the incident called u_escalate_comments?

gr.setValue('u_escalate_reason', input.reason);

gr.setValue('u_escalate_comments', input.comments);

gr.setValue('u_escalated', true);

gr.setValue('u_escalated_by', gs.getUserID());

gr.setValue('comments', 'incident escalated');

Regards

Ray

Hello Ray,

Thanks for the response. It worked. I need to provide extra spacing around the widget as shown below.

find_real_file.png

In the escalation widget it is as shown below

find_real_file.png

Can anybody help with this?

Hi ,

Can you share the template code?

Thanks

@raycallan Have you achieved this? Can you please share the code?