Jump to content

Renumber Portal Records


This topic is 6564 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I would like to select and delete a record from the middle of a portal and then renumber the remaining portal records #'s sequentially, from 1-12. Do I need to use a loop script and end when the script reaches the bottom (end) of the portal?

Thanks,

Jason

Link to comment
Share on other sites

Do I need to use a loop script and end when the script reaches the bottom (end) of the portal

Hi Jason,

That would certainly be an option.

However I wonder if you really need to store a portal row number as data in the first place?? If you just need it for display purposes, you can create a dynamic row number by using the @@ symbol in a text object within the portal row? The resulting numbers will automatically adjust to accurately show row numbers in the portal.

You may well have your reasons, but if not, it seems like the @@ trick would be a good deal simpler/easier. :)

Link to comment
Share on other sites

Hi CobaltSky,

Thanks for your response. I need to include the row number because, as a separate issue, I want to allow the user to adjust the sort order in a random fashion. This solution is exam generator. Question 5 follows 4, ... etc. The questions are listed in a portal. In addition to being able to delete a question, the author may want to put one question before another.

So my row number is my question number. The author may delete a question, in which case the question numbers need to dynamically adjust, or the author may change the order of questions, in which case it would be nice to have the question numbers dynamically adjust as well.

Now that I think of it, this is kind of like a bibliography program (eg, Endnote) where if you delete or move a reference, the remaining references dynamically renumber.

I did not understand the @@trick. I created a field and put in my portal and placed the symbols "@@" in it. Is this what you meant?

Thanks,

Jason

Link to comment
Share on other sites

...I need to include the row number because, as a separate issue, I want to allow the user to adjust the sort order in a random fashion.

Okay, that being the case, a looping script that renumbers the rows may be the most appropriate.

You may also wish to use a looping script to re-assign question numbers when changing the question order.

I did not understand the @@trick. I created a field and put in my portal and placed the symbols "@@" in it. Is this what you meant?

Yes, that's what I meant. If you insert the two @ symbols into a text object in layout mode, when you view the layout in Browse mode, the @@ will be replaced with the current record number.

If you place the @@ into a portal row, in Browse mode, it will appear as the corresponding portal row number. :wink2:

Link to comment
Share on other sites

I set up the loop (my first) and it worked great. I don't understand what a text object is...

A text object is created in layout mode by selecting the text tool from the Status Area (it's the one that has the capital A symbol on it) then clicking on the layout where you want to place the object and typing some text.

Once you create a text object in this way and enter @@ into it, then go back to browse mode, you'll see what I was referring to. :wink2:

Link to comment
Share on other sites

This topic is 6564 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.