Notifications

25 views

Description

The data policy engine complains about fields should be read-only, invalid insert

 

STEPS TO REPRODUCE:

  1. create a data policy on the table [incident], no condition
  2. create the data policy rule for field "description" set to read-only.
  3. open new form on incident, set the description field with the follow script in the console
  4. g_form.setValues("description","Some Text");
  5. submit the form

    We get an invalid insert, where before it would work

 

Release or Environment

New York and above

Cause

  • The change in behavior to your upgrade above New York is actually a fix to a PRB
  • PRB1314728 - Modified DataPolicyManager.java to handle Null pointer exception that results in incorrect processing of the valid data policies when the glide element is passed as null.
  • What you were experiencing before was a bug
  • When viewing session debug on the previous instance, when the data policy engine runs we get a Null Pointer Exception:
    log20:04:06.102: Error running script engine: java.lang.NullPointerException:
    com.glide.data_policy.DataPolicyRule.appliesToReadOnly(DataPolicyRule.java:84)
    com.glide.data_policy.DataPolicyManager.testAction(DataPolicyManager.java:254)
    com.glide.data_policy.DataPolicyManager.testPolicy(DataPolicyManager.java:95)
    com.glide.data_policy.DataPolicyEngine.runEngine(DataPolicyEngine.java:50)
    com.glide.policy.AScriptEngine.process(AScriptEngine.java:34)
    com.glide.script.ScriptEngines.run(ScriptEngines.java:102)
  • a most likely cause for the NPE is a data policy rule that is using a field that does not exist

 

Article Information

Last Updated:2020-05-07 00:54:07
Published:2020-04-04