Solved

Primary key violation - which record is then valid ?

  • 31 May 2021
  • 1 reply
  • 36 views

When you set up primary key behaviour to 'error' you elegantly force all valid data to be unique combinations of your selected primary keys. But, how do you control what individual dataset is regarded as valid and what is discarded as error ?

Is there a way to let the primary key violation error handling know, which record you consider the valid one ?  (e.g. based on min/max values in non-primary key data fields)

icon

Best answer by Syed Yousuf 1 June 2021, 02:33

View original

1 reply

Userlevel 3
Badge +3

I do not think there is a specific way to control the order. It is usually what row comes first that is allowed to stay and the following ones are sent to error. Also you can't control what order rows are added in.


If you map more than one table, changing the order of them, may make an difference in which one is first, but I am not sure.

In general it would be better to figure out a way to make each row unique, or find a data selection rule that can remove the ones you do not want.

 

Another solution could be to deactivate the primary key violation error handling on the specific table and instead create a number of transformation fields on that specific table to identify the valid record. This transformation would then compute to either 1 or 0. And then finally set a field validation rule to look for 1 on that field.

Reply