5 Replies Latest reply on Aug 19, 2010 9:37 AM by philmodjunk

    sorted sequential ID for  Portal records (sorting)

    Born2Frag

      Title

      sorted sequential ID for  Portal records (sorting)

      Post

      Hello,

      I have a portal in a layout. the records in the portal are sorted by say field1. There exist a column, field2 which is intended to have a sorted ID like, 300.01,300.02,300.03... . I have managed to create such Id's as records are inserted. However, if a record is insered somewhere in between some existing records, the sord is distorted becasue records are sorted over field1 not field2. Example of such a result after insert could be 300.01,300.02,300.33,300.02.

      How can I regenerate these ID after possible inserts such that the newly generated IDs are sequentially sorted without actually doing sort over this field? Any posibilities of a script to fire when a "rearrange" button is pressed ...?

      Thanx

        • 1. Re: sorted sequential ID for  Portal records (sorting)
          philmodjunk

          Wouldn't it be simpler just to include field 2 in your portal's sort order?

          • 2. Re: sorted sequential ID for  Portal records (sorting)
            Born2Frag
            Phil, It is not the requirement! the situation is this: portal records are listed by headers. meaning, those records under same header(header being part of the portal record)must be listed under the header they belong to. however, 'field2',that i referred as, is a field for all portal records where a sequential number (sorted in ascending order) is required regardless of headers. You can  see that when a record under header1 is inserted way after header2,3,etc are part of the portal record, this newly inserted record(under header1) will have a a value in 'field2' greater than that of header2,3,etc. as it was inserted way after header2,3,etc. I hope I clarified the problem better this time.
            • 3. Re: sorted sequential ID for  Portal records (sorting)
              philmodjunk

              You might try using a script that uses a layout based on the portal records and either a find or Go To Related Records to pull the records up in a found set on that layout and sort them in the desired order. Then, Replace field contents or a looping script can be used to renumber the records in the desired order.

              What's not clear from your post is how to determine that correct order just from the number series: 300.01,300.02,300.33,300.02

              • 4. Re: sorted sequential ID for  Portal records (sorting)
                Born2Frag

                the correct order is achieved by another field value.

                this is the case. when the first item is inserted it gets 300.01, the second 300.02 etc.. when the 10th Item is in it gets 300.10 value in field2. however, it might end up being between 300.01, and 300.02 depending on the sort result on the "header ID" field.

                now, I want to regenerate these values of "filed2" such that it is sequential as sorted in the portal.

                one possibility is to regenerate everything below this field including the value of it, but could not figure out how to do that. any possibility of using recordID, portalrecordnumber etc. how can we uniquely identify portal rows after a sort operation done on it?

                or anyother clue?

                • 5. Re: sorted sequential ID for  Portal records (sorting)
                  philmodjunk

                  This is what I don't understand: If "the correct order is achieved by another field value." Why can't you just include this field in your sort order? That was my original suggestion.

                  I think some key details are missing here. Before I offer any other suggestion, I'd need a much more detailed description of what you are trying to accomplish here.