7

I'm creating a Hybris impex file to import into my Database.

I want to perform an INSERT_UPDATE action with the data from the file, so I need to tell Hybris which column(s) need to be unique, so that it knows when to update a record instead of insert it.

I know that to tell Hybris that a certain column needs to be unique I can add the unique attribute to that column, like this:

INSERT_UPDATE SLEmployee;Firstname[unique=true, required=true];Lastname[required=true];Function;

But on my example above, how do I tell Hybris that the combination of the columns Firstname + Lastname must be unique?

Sanchit Khera
  • 1,005
  • 1
  • 16
  • 47
Henrique Ordine
  • 3,337
  • 4
  • 44
  • 70
  • Have a look at this - https://stackoverflow.com/questions/71546100/sap-hybris-how-to-display-specific-products-at-top-results-after-search – Ravi Mar 20 '22 at 11:04

2 Answers2

15
> how do I tell Hybris that the combination of the 
> columns Firstname + Lastname must be unique?

Add the unique keyword to every field that is part of the combined key

 INSERT_UPDATE SLEmployee;Firstname[unique=true];Lastname[unique=true];Function;
k3b
  • 14,517
  • 7
  • 53
  • 85
  • exactly this. you can just add multiple unique attributes to a field and hybris will make sure it matches them all. – lawl0r Nov 29 '12 at 21:00
0

While creating attributes in itemtype, make sure unique modifier is set true for all the attributes you want to be considered for the combination. Prepare data accordingly.

Ash
  • 37
  • 4