Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Using g_form.setValue() on a Duration field does not work correctly if you pass the value from another Duration field - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Using g_form.setValue() on a Duration field does not work correctly if you pass the value from another Duration field
KB0752390

Using g_form.setValue() on a Duration field does not work correctly if you pass the value from another Duration field


2730 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Description

Using g_form.setValue() on a Duration field does not work correctly if you pass the value from another Duration field. The field will show the value correctly, but saving the record does not commit the change. However, if you set the value of the field and then click within one of the inputs for the field, then the change is committed.

Steps to Reproduce

1. Add a Duration field to the Incident form. Call it 'test_duration'
2. Open an incident record and add a value to the Duration field. Copy the sys_id of the Incident record and Save.
3. Create an onChange client scirpt on short_description. In the script, use GlideRecord to get the incident you copied the sys_id for and use g_form.setValue() to copy the Duration field from GlideRecord into the current record.
4. Open a different Incident record and change the short_description to trigger the script (you might have to click out of the input field)
5. Notice that the value was copied into the Duration field successfully. Save the incident.
6. Go back to the same incident and notice that the Duration field was saved correctly (still shows all 0's)
7. Try again, but this time when the value for Duration is changed, click within one of the inputs for the field. Save the record.
8. Go back to the incident and notice that the value was saved correctly.

Workaround

After carefully considering the severity and frequency of the issue, and risk of attempting a fix, it has been decided not to address this issue. We do not make this decision lightly, and we apologize for any inconvenience. If you have any questions regarding this problem, contact ServiceNow Customer Support.


Related Problem: PRB1274011

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.