What I am trying to accomplish is to prevent creat...
# suitescript
a
What I am trying to accomplish is to prevent creation of multilevel customers. We only want to allow one level of subcustomer. I created a user event and before submit it gets the parent field and searches if that has a parent field
b
there are 2 conditions
you cant set the parent if customer has children
you cant set a parent who also has a parent
a
Correct
That's what I wrote in the next post
b
theoretically you can do it in one search
but its a lot clearer if you do 2
a
you cant set the parent if customer has children
My question is how you can know this?
Although I guess once this is set up there will never be more than one level
Therefor it is enough to check that this is not a top level parent on any child
b
use the parent customer join
a
My original question is how can you search down if the
parent
search column doesn't go up one level, it goes to the top
b
there is a difference between the Parent Customer join and the Top level Parent join
a
But the answer is there is no top, since we aren't allowing more than one
b
do not use the parent column
a
Ah! Thanks! That's the point I was missing
I didn't realize there were 2 different filters
b
im not even sure the distinction matters
a record that has grandchildren still has children
and a record that has grandparents still has a parent
a
in theory it could if you wanted to allow 3 levels but not four