Notifications

94 views

Symptoms


After upgrading to London, when making changes to a project, the record is not saved and an error is displayed:

Custom state '' is not mapped to any state bucket. Please contact System Administrator to verify the setup.

Release


London Patch 1

 Cause


The "State" field is missing in the project form and, for that reason, the script on the Save UI Action is returning false.

From the Save UI Action on "pm_project" table we can see:

var ga = new GlideAjax('AjaxProjectUtil');
ga.addParam('sysparm_name','getMessageForStateChange'); ga.addParam('sysparm_sys_id',g_form.getUniqueValue()); ga.addParam('sysparm_state',g_form.getValue('state')); ga.getXML(handleResponseForSaveProject);

Since the "State" field is not enabled on the form layout, g_form cannot get any value and the state validation is failing as an empty state is being passed. For that reason, the call on AjaxProjectUtil is returning a failure and the project is not saved.

This scenario may occur for customers who do not use the "State" field and the OOB related functionalities to manage their projects.

Resolution


 To avoid this behavior, there may be different approaches:

  • Customize the "Save" UI Action script on "pm_project" table so the state field is not validated;
    • On the navigation, select "UI Actions" under "System UI";
    • Search for the "Save" action on table "pm_project" (OOB has the sys_id 02a84907d7503100b7490ee60e610365);
    • Customize the "Script" field so that the "State" is not validated;
  • OR, Make the "State" field selected on the form layout and hide it through a UI Policy:
    • Open any project, and configure form layout (Click the action menu on the top left, then click Configure -> Form Layout);
    • Add the "State" field to the "Selected" list on the slush-bucket and click "Save";
    • Create a new UI Policy (navigate to "UI Policies" under "System UI") and click "New" on the header);
      • Table: pm_project;
      • Short Description: Enter a description;
    • Right-click on the header and choose "Save";
    • After the form reloads, the "UI Policy Action" related list loads;
    • On the related list click "New" to create a new action;
      • Field name: State;
      • Mandatory: False;
      • Visible: False;
      • Read-Only: True;
    • After saving the UI Policy, reload the project form and check that the "State" field is not visible but you can now save the project.

 

 

 

Article Information

Last Updated:2018-11-13 07:14:30
Published:2018-11-13