Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Number-attribute that increments itself?
Jaak_Tammemagi_(jtammemagi_(Delete)_1729419)
Hi everybody. I am pretty new in Livelink development. Could anybody give me an idea how to build a code which increments automatically certain number-attribute? We have a category with several attributes in it and on of them is so-called "document-number". When a document is added to that category the "document-number" should be incremented automatically. The attribute itself should remain as standard as possible (to guarantee search functionality). Thanks in advance.Jaak
Find more posts tagged with
Comments
Application_Services_FUJITSU_(fuji_ware05_-_(delet
Hi,It seems a simple request, but implementing this could be very hard.I think the most simple way to enforce this is doing the next (if it fits your requirements of course)First a document is not added to a category but a category is assigned to a document.IMO the best thing you can is do is defining a new nodetype (inherited from document). If you add your document automatically assign the category to it and calculate the next ID.How to calculate the next ID? Livelink has a table called KID. For a certain nodetype you can add an ID. Each time you create a node of your nodetype you can get the ID, add 1 and store it again in the table (e.g. in the NodeSubclassCreatePost method of your nodetype).Hope this helps you. If not let me knowmailto:jraedemaeker@switch.be
Jaak_Tammemagi_(jtammemagi_(Delete)_1729419)
Thank you for the reply! But how to define a new nodetype? We have only 1 row in our KID table, which shows next ID for the nodetype 0.Jaakmailto:jaakt@ml.ee
Robert_Davies_(unlondonadmin_-_(deleted))
The simple, not too useful, answer is on page 58 of the Module Development Guide: "Modifying Existing Node Functionality." Unfortunately this answer depends upon you knowing how to use builder to create modules, orphan objects, etc, etc...I've never gone through these steps to the point of unregistering the original node. I am also not sure from reading them how the new node type "inherits" the documents created under the old node type (since you are changing the subtype number). Maybe you have to run a SQL query and change them in the database?Perhaps someone who has done this knows?Best regards/matt.
Application_Services_FUJITSU_(fuji_ware05_-_(delet
I was told that changing the database is not a very good idea. BTW: the new documents that you will add will have the original subtype again. And LL has no function to change the subtype. This seems logical as the behaviour depends on the subtype and maybe you have not the correct data stored in the DB.Anyway what to do?Add a new nodetype (LLNode+Webnode) give it a seperate name, a subtype, some html layouts.... See Module development guide and adding new nodetypes. In the many methods you have available by default write your code. (BTW don't forget to derive your nodetype from document, then you have all document-functions available from the start) Concerning the nKID table... add a record with you subtype starting from ...(1?)each time you add a document you will get the value add one and save it again in the table..(e.g. in the NodeSubclassCreatePost methode) the new value is the ID for you customised document.....This should help you a lot..In case of further problems...mailto:jraedemaeker@switch.beJohan
Cor_Zelissen_(czelissen@interport.nl_-_(deleted))
HelloWe developed a module "numbergenerator" This module generaties a unique number based on on userdefined format. This number can used for docs, compounddocs and soMaybe it is what you looking for?More info: czelissen@interport.nlCor