Hmmmmm...... I expected this to be simple but have been playing around for a week with it now and
cannot get it to work.
Imagine I have a BO called MyList which has the folowing attributes
MyList.Order
MyList.MyText
When the system first initialises it creates 7 default records in order 1 thru 7 via a Process
called InitMyList
IF COUNT MyList = 0
CREATE MyList WITH MyList.Order=1,MyList.MyTest='My 1st Item of Text'
CREATE MyList WITH MyList.Order=2,MyList.MyTest='My 2nd Item of Text'
CREATE MyList WITH MyList.Order=3,MyList.MyTest='My 3rd Item of Text'
CREATE MyList WITH MyList.Order=4,MyList.MyTest='My 4th Item of Text'
CREATE MyList WITH MyList.Order=5,MyList.MyTest='My 5th Item of Text'
CREATE MyList WITH MyList.Order=6,MyList.MyTest='My 6th Item of Text'
CREATE MyList WITH MyList.Order=7,MyList.MyTest='My 7th Item of Text'
I also want the ability for the End User to add a record and have it added to the bottom of the list. So I have a
Rule on the BO...
IF MyList is NEW
MyList.Order=COUNT MyList +1
So when I call InitMyList as the system start it CREATES the records ok BUT it is executing the Rule on the BO so instead
of having record numbered 1 thru 7, I end up with records numbered 2 thru 8 where the Rule is adding 1 to each Order value.
So I tried adding NO VALIDATION to the end of each CREATE as follows...
IF COUNT MyList = 0
CREATE MyList WITH MyList.Order=1,MyList.MyTest='My 1st Item of Text' NO VALIDATION
CREATE MyList WITH MyList.Order=2,MyList.MyTest='My 2nd Item of Text' NO VALIDATION
CREATE MyList WITH MyList.Order=3,MyList.MyTest='My 3rd Item of Text' NO VALIDATION
CREATE MyList WITH MyList.Order=4,MyList.MyTest='My 4th Item of Text' NO VALIDATION
CREATE MyList WITH MyList.Order=5,MyList.MyTest='My 5th Item of Text' NO VALIDATION
CREATE MyList WITH MyList.Order=6,MyList.MyTest='My 6th Item of Text' NO VALIDATION
CREATE MyList WITH MyList.Order=7,MyList.MyTest='My 7th Item of Text' NO VALIDATION
with the expectation that the Rule on the BO would not be executed after each CREATE in the Process, but it would be executed if a
user enters a new record.
I must be interpreting the use of this incorrectly as no matter what I do, the Rule on the BO always gets executed.
Any suggestions would be appreciated