Question

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?

Was it helpful?

Solution

> 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;

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top