How does the removal of Value Picklist

from Adolfo Demian Raschkovan’s blog (Spanish)
In this post I will try to explain what happens when you delete a value of an attribute of type “Picklist” (down).
It’s a bit curious operation, even a little sketchy for my taste.
Let’s see an example and we will review as is the information in the SQL Server.
First we will create a new attribute in the entity of “Cold Case” and add it to the form. It will be a dropdown with the name “new_categoria” with values “A”, “Two”, “Three”

Atributo picklist

Create a record of “Case” with the value of Category in “Two” and then do a couple of queries in SQL Server to see what we have physically stored in the database and the FilteredView:

SELECT * FROM IncidentExtensionBase
SELECT incidentid,New_Categoria,New_Categorianame FROM FilteredIncident
Resultados consulta

So far, so normal, however, imagine that we need to eliminate the value of the drop-down “Two.” When we remove the following message appears:
“If a registry value that is used to remove, update the log to use another value in order to save this change. After removing this value, you can not use it to find this record in the application. Do you want to continue?”

Reading it would seem that what is going to do is replace the records with this value and leave it to null, but in reality it is not.
Delete the value and return to do the same query as before:

Resultados consulta 2
As seen, in fact in the database we still have the same value, but what happens is that you can not pick up the text of the FilteredView value, which is normal because the value is removed.

Imagine that last time, we add a new value in this down with the same value (2) as an index, but with text means something else:
Atributo Picklist 2

We again make the query and get:
Resultados Consulta 3

With this result we get, that deleting a value from a dropdown, the records associated with this value, remain the same, and are not deleted, in fact if we do an advanced search for that attribute filtering that “contains data” will find it because it has data, but it is a fact “nonexistent.” It should also be aware that if you create new items in the drop in existing rates, would be replacing and modifying an old value that no longer interest us.

The final conclusion and advice is to leave take good care of leaflets and in particular by eliminating the values, I think it is good practice not to allow end users to manage these attributes.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: