4 Replies Latest reply: Aug 18, 2014 8:21 AM by 2728247 RSS

    Auto incrementing Sequence/ID?

    2728247

      Hello everyone,

       

      I have the following requirement:

      When adding a member to a node, a customized property (lets call it Seq_ID) should auto increment by +1.

       

      For example:

      Node1

      - Member A, Seq_ID = 1

      - Member B, Seq_ID = 2

      - Member C, Seq_ID = 3

       

      When adding Member D, the Seq_ID shall be set to 4 automatically.

      So far i have discovered, correct me if I am wrong, this is only possible with a derived / script property. I tried a few JavaScripts I had in mind but was not successfull.

       

      I appreciate any help

       

      Regards

       

      Pascal

        • 1. Re: Auto incrementing Sequence/ID?
          Denzz

          Hi,

           

          Wouldn't the NodeId property help you? do you still need a custom property?

           

          Can you give more specific details on whether this increment is required on a specific branch of the hierarchy or on the whole of it.

           

          To me it looks like NodeId can be used, if not please help me understand why it cant be utilized.

           

          Thanks

          Denzz

          • 2. Re: Auto incrementing Sequence/ID?
            2728247

            Hello Denzz,

             

            thank you for your fast response.

             

            Unfortunately the NodeID can not be used. Yes it is an unique identifier but is used "version wide". When adding a node in hierarchy A the node will have the NodeID 10, when adding a node in hierarchy B the node will have the NodeID 11.

             

            What I basically need is a sequence or ID that is only used for one level as you can see in my example above.

             

            Another example could be: We have a node that contains 3000 different products. When adding a product, the product ID should be automatically be set to 3001. This way it is very easy to filter throught products, for example "Show me products where ID between 100 and 150".

             

            Thanks in advance!

             

            Pascal

            • 3. Re: Auto incrementing Sequence/ID?
              Denzz

              Pascal,

               

              In that case you can try something like this

               

              ArrayIndex(Abbrev(),ParentPropValue(Core.ChildList),[Comma])

               

              See if this works for you.

               

              Thanks

              Denzz

              • 4. Re: Auto incrementing Sequence/ID?
                2728247

                That will work! Thank you very much & sorry for the late answer