Skip to main content

Search

Sublist Item No doesn't update when items removed

Comments

3 comments

  • Pius Willi

    Hi Gareth,

     

    Inside the calculated Expression you will only increase the number, and actually not search for the Item with the max number. So if you delete a Sublist-Item, this expression ("++window.lastPositionNumber") will be triggered again and increase your number.

    Instead, you should be able to use a recalculating Expression [[@SubLists.Monthly_Items.Item_x0020_No.Count]] or [[@SubLists.Monthly_Items.Item_x0020_No.Max]] inside your calculated Expression directly.

     

    Kind regards

     

    Pius

     

    PS: 

    Unfortunately, I am not able to see the Images. So hopefully i did get your question anyway?

    Can you please add them to your post.

    0
  • Gareth Jayne

    Hi Pius

     

    Thank you for the quick reply and apologies about the pictures not appearing.  I've now updated my original post so hopefully the images are visible now.

     

    As you can see from the images the issue is if I delete an item that isn't the last one in the list.  I was wondering if there's a way I can then recalculate the item numbers for all remaining items and adjust them?  In my example above, after deleting Item 2 I would want the number for Item 3 to automatically change to 2 to fit in with the new order.

    0
  • Pius Willi

    Hi Gareth

     

    Now (with the added images) I understand what you try to reach. Unfortunately, I do not have an easy solution for you. When you delete a subsist item, the only expression that will be trigger, is the one for the item, before the deleted one.  

     

    The only thing comes into my mind, would be to write a script to grab the active cell of the current item and then iterate over the table cells below the item and update the values. All by custom jQuery/js scripting. And you must go sure to only trigger this update process if an item was deleted.

     

    So, not an easy task. Sorry for the bad news.

     

    Kind regards

     

    Pius

    0

Please sign in to leave a comment.