lazovic Was that you? Thank you.
The unfinished one created endless records but I fixed that.
Thanx again
Create duplicate records automatically
Collapse
X
-
With a modification of a code that someone posted here (and was deleted) I did it with:
PHP Code:$n = quantity - 1; $i = 0; while($i < $n) { record\create('CLicense', 'licenseType', licenseType, 'kind', kind, 'serial', serial); $i = $i + 1; };Leave a comment:
-
Create duplicate records automatically
I have an entity 'CLicense' with a field 'quantity'.
I am trying to have a formula to autocrate 'quantity -1' extra duplicate records when I save the original record.
Trying to use the while function:
I get error 500 when I am trying to save the original record.PHP Code:$n = quantity -1; $count = record\count(CLicense, "serial", serial); while($count < $n) {record\create(CLicense, 'licenseType',licenseType, 'kind', kind, 'serial', serial)};
It is my first time with the while function and I am a bit lost here.
Tags: None

Leave a comment: