Solved

Copying columns also copies the "identity" value

  • 19 March 2019
  • 2 replies
  • 100 views

Userlevel 4
Badge +6
When I copy columns in the SF it also copies the value of "Identity". I cannot imagine a situation where you want to have two columns with the same name with "identity" = 1 on different tables / views.

In what situation would you want this to be possible?
icon

Best answer by Jeroen van den Belt 19 March 2019, 11:52

You want this to be possible because the GUI/Indicium must be signalled that the concerning field in the view is an auto numbering field. It needs this information so that after adding a record, it can retrieve the correct value in the right way.

You can do this by setting the identity checkbox for the corresponding column in the view, which in this case is already done since you were copying the column.
View original

2 replies

Userlevel 5
Badge +4
You want this to be possible because the GUI/Indicium must be signalled that the concerning field in the view is an auto numbering field. It needs this information so that after adding a record, it can retrieve the correct value in the right way.

You can do this by setting the identity checkbox for the corresponding column in the view, which in this case is already done since you were copying the column.
Userlevel 4
Badge +2
I don't see why having two identity columns with the same name in different tables is necessarily strange. You could argue that whenever this situation occurs, the developer is using poor naming conventions, but that's just an opinion and there might be situations in which it is actually the best solution. There is nothing inherently wrong with naming all of your identity columns "id" and I bet there are projects out there for which this is the case.

In general it is good design to keep things simple and obvious and not make exceptions based on assumptions about a user's intent. If we were to do something about this, I would suggest a transparant solution such as adding a "Include identity" checkbox to the "Copy column" task. If you think that's a good idea, you can submit it.

Reply