Add a NEW column to an existing Smartobject which has Data in

  • 27 June 2017
  • 1 reply
  • 32 views

Userlevel 3
Badge +16

Hi,

 

Wondering which is the safest advice to avoid messing up a Smartobject containing data.

 

Ok, the scenario is that i have a table, which according to the specificiation had 10 columns and the form has been in use for a while.

So i have a Form with an Editable list displaying all the data in these 10 rows and have the Toolbar buttons on the top, so Admins can add/edit/delete records...

 

All good so far and works fine.

 

Now, the requirements have changed and i've been asked to archive off records that are deleted. I was thinking of doing the following:

 

1) Add another column and add some sort of flag (but will adding a new column, mess up my SAVE Methods and would i have re-create rules/mappings again?

2) Create a seperate Smartobject with 11 columns, and have the Form copy over the Record which was deleted to this Archive Smartobject? When i click delete, the record is not deleted until I also click the Save Toolbar button, so how would i accomplish this?

 

Is there any other easier way you guys can suggest?

 

Thanks


1 reply

Userlevel 3
Badge +5

Add an isDeleted column to your existing smartobject, modifying each of the methods to add the field . If it's in SQL you could index that column. 

 

In the List method, where you might display a list of records, specify false for the isDeleted field. 

In your Delete method, simply save the record with it's isDeleted field set to true.

 

Look at K2 SmartStarters for an example.

Reply