We're actually digging this, is it? Can you please share the node name and the error message you are getting.
Apologies for the late reply.
Node name is any number which is 11 digits long (12345678900) and the error message is the error message i created while creating the Validation.
The validation is firing even for the correct code.
Not sure why it would fire even for the correct node, I know you would have already but check the error mesage to see if it is for the node that you are trying to add or for its parent or some other node. If it is for the same node then I give up.. at my side of the DRM its works just fine.
Am back with the validations ghost! It works now for the integer part but though my formula checks for the numeric part of it, it is not firing when i'm trying to create a code with alpha numeric characters.
All checks have been done - Code has been defined as an Integer, Validation assigned to Node Type, Real-time and Inherited checked.
Is there something i'm missing here? Used the same formula you mentioned earlier.
I'm using version 126.96.36.199.
I'm also facing issues with the validation for required/mandatory fields for every hierarchy before a node can be saved. How can you configure such validations? Please help.
Ok just to verify, what is the return value used on the validation. False Or True?
And about the mandatory fields its a little tricky as it won't let you save a node unless the properties are populated and you can't populate properties unless you have them created, I am sure this exact req can't be met unless you have a Front end application which adds nodes through webservice calls. Let me check if there is a workaround for this.
Many Thanks for the reply mate!
I have this formula for checking the value of the property which should be an Integer and not be less than or more than 11 digits (I have many requirements like that) :
I guess if the condition is satisfied, it shouldn't fire (True value) and if it is not satisfied it should fire. Property definition for the property in question is Integer data type and non overridable Derived (if(NOT(NodeIsLeaf()),propvalue(Core.Abbrev),)).
Regarding mandatory fields, i knew it won't work Real-time (unless you have a value called NULL for example by default for strings and 0 for Integers and consider those valid values for every property) when you create a new node.
Mandatory fields probably should be implemented as a batch validation (letting the user create a node with default or blank values and then validate it using the batch validation later) but i'm looking for the best validation class to implement. And also is there anyway we can force a user to move nodes starting with 1 to be only placed under parents starting with 1 and return an error if he tries to place it under a node starting with any number other than 1? These nodes are from different hierarchies (Child will be from Hier1 and Parent will be in Hier2).
If the condition is satisfied it will return TRUE and if it si not then it will return FALSE.
IF the return type in your validation is False, the condition should return False for the validation to Trigger.
In the formula mentioned above your return type should be False.
What is the Property for, Sorry didn't understand that.
For the parent Validation- You can build a formula around Core.Parent and check for the first character to be 1.
That is exactly what my formula is doing (when i test this formula against a node which is either an alphabetical string or an integer code which is less than or greater than 11 digits, it shows False which means it should fire but it isn't firing for string type node only but fires for integer type).
The property definition i mentioned is for the property whose value i'm checking using this validation.
I'm testing the validation by trying to create a code which doesn't satisfy the criteria mentioned in the validation and i'm expecting the validation to fire. The value of 'name' property of the new code is what gets stored in the property i'm checking using this validation.
Length Check of a property called GL Account Code (should be 11 digits only) - it has a formula which picks up the value automatically from the name property.
Surely this can't be difficult!
The second validation is to check whether a code starting with 1 in a hierarchy is placed under a code starting with 1 only in another hierarchy and return an error if it isn't the case. Do you think using HasChildWith function in the destination hierarchy checking for the first digit of the parent would work?
Sorry but i haven't got it yet, What is the return type on your validation? False Or True?
Yes why not , you can use HasChildWith, just use exact condition that you wish to evaluate, You can also check that if a node's Core.Abbrev first character is 1 then its parent's Core.abbrev should have first character as 1. which ever way suites you the best.
When you say return type, default is True isn't it if my condition is satisfied and False if not and it should fire!
Would this be more clear?
You have put this in a Formula Class Validation, Correct?
If it is still not working, Go to the Hierarchy place the cursor on the Node which didn't fail(Don't click It) It will show which Node Type is being resolved on that node. Check if that NodeType has this validation. Just to reaffirm
Also. you have enabled the validation on the hierarchy i believe.??
Those invalid nodes will not have any node type as the node type is being dynamically decided based on another property called Account Type which has a formula :
if(AND(ISNUMERIC(Propvalue(Core.Abbrev)),Equals(Integer,Length(Propvalue(Core.Abbrev)),11)),GL Account,if(Equals(String,SubString(Propvalue(Core.Abbrev),1,5),3-7-2),3-7-2 Account,if(AND(Equals(String,Propvalue(Core.HierName),BE_SchA),ISNUMERIC(Propvalue(Core.Abbrev)),Equals(Integer,Length(Propvalue(Core.Abbrev)),8)),SchA Account,if(AND(Equals(String,Propvalue(Core.HierName),BE_SchC),ISNUMERIC(Propvalue(Core.Abbrev)),Equals(Integer,Length(Propvalue(Core.Abbrev)),10)),SchC Account,))))
The highlighted bit of the formula decides if 'GL Account' goes in the Account Type property based on the notation of the new node being created. So it looks like because a node type has not been assigned to the invalid node that i'm creating (and hence no validation assigned), it is not firing?
Instead i might have to use HierName and Level to check for any node to populate the value GL Account (which means any code can be a GL code to start with as long as it is being created in the correct hierarchy and correct level) and that will allow any node to have the correct Node Type (which is decided by the value in the Account Type) and the validation might fire!
I guess IsNumeric is acting weird, i tried at my end and its firing haywire...Could be a bug.. let me research a bit.