Hi i want to disaplay auto generated unique document number for every document generated and save it as its metadata. I have tried sys :dbid but its always null.
You looking for nodeRef or database id? NodeRef is something you can easily get as soon as node is created so you can create rule which call a javascript when new node is created and add logic of setting custom property to keep track of that noderef because you will already have access to noderef in that script(document.nodeRef).