1
0
-1

I've imported a Dynamic Data Service from another server (4.3.4 -> 5.0), and am getting this error. What does it mean? (This is a part of a Maestro form migration)

Do I need to get a developer to look at this, or is this likely to be a common configuration issue?

  1. Sacha Trube

    Likely to be generated from this like of code: def orgKey = request.getParameter("org_abn").replaceAll("\\s","");

CommentAdd your comment...

3 answers

  1.  
    1
    0
    -1

    Thank you Brett and Ben: Yes it appears that the value was null, but it should not have been.

    Turns out that this was caused by a Maestro misconfiguration, where I accidentally mixed up the input field mapping on the Dynamic Data Button. Turns out that I put the key into the field reference column, and the field reference dependency into the Key column.

     

      CommentAdd your comment...
    1.  
      3
      2
      1

      It's good practice to use the null-safe navigation operator ?.

      def orgKey = request.getParameter("org_abn")?.replaceAll("\\s","");

      See also: http://groovy-lang.org/operators.html#_safe_navigation_operator

      1. Sacha Trube

        Understood, but based on your answer, perhaps I should ask the question in a different way: Why is that value null? (It's a standard Dynamic Data Service, and "org_abn" is just a field in my maestro form). Perhaps I have mapped the fields incorrectly?

      CommentAdd your comment...
    2.  
      1
      0
      -1

      From a code point of view, it's because the data it's trying to replace doesn't exist. so you probably have records without a org_abn. you can check for existing text, or place nulls with "" before that line.

      eg

      If (request.getParameter("org_abn")!=null)
      	def orgKey = request.getParameter("org_abn").replaceAll("\\s","");
        CommentAdd your comment...