Dear OF team,

I would like to implement autonumbering for tree individuals such as in this post: https://www.openforis.support/questions/2681/start-value-for-automatic-numbering The field 'num' containing the automatised numbering of tree individuals should not be visible in the data entry form.

I implemented two lines of code:

(1) Constant value = 1

(2) Expression = 'math:max(parent()/a_in_ind/num)+1' apply when 'count(parent()/a_in_ind) > 1'

Adding the first individual works fine but when adding a second, OF runs into the following error: 'Circular dependency found in graph for node /transect/a_in_ind[2]/num'

Thus far, my workaround is to have the 'num' field not calculated, with the very same default expression as mentioned above: 'math:max(parent()/a_in_ind/num)+1'. This works perfectly fine but leaves the 'num' field editable in the data entry, which is a possible source of error, if accidentally modified.

Thanks for any help regarding this problem.

Best, Jan

asked 24 Oct '22, 15:02

janklein's gravatar image

janklein
215
accept rate: 0%


Dear Jan,

one option is to create a calculated attribute and use expression "idm:position()" and in properties uncheck "Show in entry form", and keep "Calculated only one time" checked.

regards Lauri

permanent link

answered 26 Oct '22, 12:10

Lauri%20%28OF%29's gravatar image

Lauri (OF) ♦♦
6652815
accept rate: 21%

Thank you, Lauri, your solution works perfectly fine

(26 Oct '22, 14:29) janklein janklein's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×493

question asked: 24 Oct '22, 15:02

question was seen: 376 times

last updated: 26 Oct '22, 14:29