Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 535.7K On-Premises Infrastructure
- 138.1K Analytics Software
- 38.6K Application Development Software
- 5.6K Cloud Platform
- 109.3K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
Validation Script: Move.Values post-move returns Unexpected Null Value

Hey all,
I'm creating a custom validation using JavaScript in DRM 11.1.2.4.302. The script needs to determine the value of a node's property before the move and compare it to its value after the move.
Name: MoveValidation
Class: Script
Level: Move
Activation: Run-Time
Code - This returns a JS error: "DRM 16009 - There was an unexpected null value":
if(move.IsPre) {
return true
}
if(move.IsPost) {
move.Values.myValue = true;
return move.Values.myValue;
}
Code - This code runs without error:
if(move.IsPre) {
move.Values.myValue = true;
return move.Values.myValue;
}
if(move.IsPost) {
return true;
}
Code - This is the code I want but it causes the same error as the first set of code:
if(move.IsPre) {
move.Values.myValue = true;
return move.Values.myValue;
}
if(move.IsPost) {
return move.Values.myValue;
}
It seems there's an issue referencing move.Values during the post-move validation. But the Validations Using Scripts documentation states that move.Values persists across pre and post move calls.
Any help or guidance would be appreciated.
Best Answer
-
Just glad I'm not crazy. Spent a few hours trying to figure this one out. Guess I'll put in a support ticket.
Answers
-
Hi,
Could you please copy the entire code over here? The piece of code that you have given here already runs absolutely fine and does not give any error.
Also, you get the error when you click on evaluate?
Thanks
Denzz
-
Thanks Denzz. So far, that's the full code because we aren't able to successfully run even that piece. Can you tell me which version you're running this from? It may be an issue in our current DRM version that requires a patch. We are on version 11.1.2.4.302.
Evaluate runs successfully, but what I noticed is that when you evaluate the script it only runs the IsPre part of a move. It does not simulate both pre-move and post-move validation runs. I validated this fact by using the following code which evaluated the value of true but when tested in the actual hierarchy returned false:
if(move.IsPre) {
return true;
}
if(move.IsPost) {
return false;
}
-
I am on 11.1.2.4.310
Yes it does not evaluate the Post part, I am wondering if that's a miss on Oracle's part.
So i checked with this- which also fails for you but runs fine for me.
if(move.IsPre) {
move.Values.myValue = true;
return move.Values.myValue;
}
if(move.IsPost) {
return move.Values.myValue;
}
-
-
We have a requirement that a specific member (Identified by the value of a specific property) in a hierarchy is the first member under its parent. The property logic sets the value to a string if the member is the first child under a parent. This validation runs to ensure that this member cannot be moved or re-ordered in a way that it is not the first member under that parent. All other members in the hierarchy can be moved at will.
So we're storing the value of this member's parent in the move.Values object as well as the value of the property that defines which member we're concerned about and ensuring that:
- Member with that property value maintains the property value and the same parent before and after move (Does not move, does not reorder)
- Members without that property do not gain that property value (Members are not reordered and become the first member under a parent)
-
Like you already said- I am beginning to notice that the values from the Pre phase are not flowing over to that post Phase.
Its in the Post phase where null reference error is coming.
-
So you are seeing the same issue then?
-
Yes i am,
It doesn't come when I evaluate it coz, the post phase doesn't get evaluated.
But i am getting it when i play with the hierarchy.
This is really ugly
-
Just glad I'm not crazy. Spent a few hours trying to figure this one out. Guess I'll put in a support ticket.
-
Had you got any resolution to this from Oracle? The move.IsPost just won't work properly its giving me that null reference error.
Thanks
Denzz