Skip to Content

Auto numbering

  • Origin: Pre-population in Workflow

In order to pre-populate a certain field with the count of all IDs in the current app +1, thus, getting a unique consecutive number for an item (invoice no, request #, etc.), enter the following expression:


@prefix cmw: <http://comindware.com/logics#>.
@prefix cmwmath: <http://comindware.com/logics/math#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix user: <http://comindware.com/ontology/user#>.
{
?item cmw:container ?container.
from {
?item1 cmw:container ?container.
?item1 user:w_maxId ?maxId.
} select ?maxId -> ?maxIds.
?maxIds cmwmath:max ?result.
(?result 1) math:sum ?value.
}