1

I'm adding 4 new checkboxes to an entity and its form. There are already instances of this entity created in production. I need to have these checkboxes defaulted to checked on these existing entity instances. I set the default value of the field but apparently this only gets used when a new instance of the entity is created. Is there an easy way to set these on all the existing instances?

I could use a one-off workflow, but I don't know how many instances of this entity there are and due to auditing requirements I can't access the production environment.

Mike B
  • 5,390
  • 2
  • 23
  • 45

3 Answers3

0

You could create execute some JavaScript on the load of the form. Of course, this wouldn't update all of the values in the database, but it would update it before a user is able to view it. Do you need all the values in the database defaulted, or will java script work?

Edit

Your best options are either an update multiple ( you can increase the number of records an advanced find returns to 250 records per page) and continue to update all records manually, or perform a batch update. See this related SO question.

Community
  • 1
  • 1
Daryl
  • 18,592
  • 9
  • 78
  • 145
  • Unfortunately I need all the database values defaulted. There is a workflow that depends on these field values that could be run against the entity from a subgrid without ever viewing the entity itself. Inverting the values would work but would be confusing to the user. – Mike B Jan 18 '13 at 18:55
  • I decided to just re-label everything to invert the meaning of the checkboxes. It's not ideal but it is acceptable. – Mike B Jan 18 '13 at 20:01
0

There's another way, too. You could write a console application that connects to your server (not that hard if you've done it before and don't have to make it general). Then, you simply execute an update on the service fetching all the existing entities and updating them after the change is made.

As @Daryl says, there's probably a way to do that from the GUI too, but real programmers do it the hard way. :)

Of course I'm kidding. I just love to type code, hehe. Never the less - once you start coding, you have full freedom to affect the data any way you need, forever.

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
0

You can do this by exporting the records and change the value for the field and then re-import back it.

Jeet
  • 1