Notifications

257 views

Description

The g_form.save() method does not save form changes when used in a client UI Action on a Project [pm_project] form.

Steps to Reproduce

  1. Login a London instance as administrator.
  2. Activate the Project Portfolio Suite with Financials [com.snc.financial_planning_pmo] plugin with demo data.
    2. Open any existing Project record.
    3. Right-click on the form header and select Configure > UI Actions.
    4. Click New.
    5. Complete the new UI action form using the following values:
    Name: SNC Test
    Table: Project [pm_project]
    Form button: checked
    Client: checked
    Onclick: saveChanges()
    Script:
    function saveChanges() {
    g_form.setValue("description","SNC TEST");
    //gsftSubmit(null, g_form.getFormElement(), "save_reload_project_form");
    g_form.save();
    action.setRedirectURL(current);
    }
    6. Save the new record.
    7. Open any existing Project record.
    8. Click the Save Project UI Action. Notice the Description field value changes to "SNC TEST" but is not retained after the form refreshes.
    10. In the UI Action record, uncomment the line that begins with "gsftSubmit", and comment out the line "g_form.save();".
    11. Test the Save Project UI Action again. Notice the updated Description value is saved as expected.

Workaround

This problem is under review and targeted to be fixed in a future release. You can Subscribe to this article to receive notifications when more information will become available.

As a workaround, consider one of the following described below.

 

Woraround#1:

The issue can be resolved by using server-side code to save, instead of using the client-side API "g_form.save();".

 

Workaround#2:

  1. Open the 'Save' UI Action of the Project table "/nav_to.do?uri=sys_ui_action.do?sys_id=02a84907d7503100b7490ee60e610365" and change line 35 to use sysverb_update_and_stay as follows:
    gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');

  2. Add the below extra lines at the end after line 43:
if(typeof window == 'undefined')
saveRecordAndReload();

function saveRecordAndReload() {
current.update();
action.setRedirectURL(current);
}

 


Related Problem: PRB1322807

Seen In

There is no data to report.

Intended Fix Version

Madrid Patch 5
New York

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-06-17 23:11:30
Published:2019-03-15