Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
sam
Advocate
297 Views, 0 Replies

iterating (& delete) through views collection

Hi all, 

I am trying to write a cleanup code which iterates through set of (section) views and if condition is true deletes certain views. Each view has distinct attribute stored with them. e.g. detailOneLeft, detailOneRight, detailTwoLeft, detailTwoRight. Code would be doing following

 

  1. Will read the attribute of first view in collection and move on (let's say the attribute name is detailOneLeft)
  2. From second view in collection it reads the attribute and if attribute name is detailOneRight , this view will needs to be deleted. 

So in summary since detailOneLeft and detailOneRight are same hence detailOneRight needs to be deleted and same goes for detailTwo..., detailThree... and so on. 

 

Thanks in advace,

Regards, 

Sam