Skip to Content
Former Member
Apr 21, 2015 at 09:17 AM

IMPEX: Document ID for required column/field not working



I'm having issues while importing a custom type, Distribution Center which has the following fields (all required):

 <itemtype code="DistributionCenter" extends="GenericItem" jaloclass="com.bose.hybris.common.jalo.DistributionCenter">
     <deployment table="DistributionCenter" typecode="11202"/>
         <attribute qualifier="code" type="java.lang.String">
             <persistence type="property"/>
             <modifiers optional="false"/>
         <attribute qualifier="name" type="java.lang.String">
             <persistence type="property"/>
             <modifiers optional="false"/>
         <attribute qualifier="address" type="Address">
             <persistence type="property"/>
             <modifiers optional="false"/>

To import our essential data for these distribution centers, I use Document IDs to assign the address to the DC. Just setting the owner of the address to the DC doesn't seem to work, the DC address reference remains empty in the HMC.

This is the essential data IMPEX:

 INSERT_UPDATE DistributionCenter; code[unique = true]; name; address(&dcID)
 ; "WSTG" ; "Bilzen, SC" ; dc1
 ; "SSTG" ; "Georgetown, AZ" ; dc2
 INSERT_UPDATE Address; &dcID; owner(DistributionCenter.code)[unique = true]; postalcode; town; region(isocode); country(isocode)
 ; dc1 ; "WSTG" ; "29016" ; "Bilzen" ; "US-SC" ; "US"
 ; dc2 ; "SSTG" ; "85353" ; "Georgetown"   ; "US-AZ" ; "US"

The error the IMPEX engine throws is the following:

 INSERT_UPDATE DistributionCenter;code[unique = true];name;address(&dcID)
 ,,,cannot create due to unresolved mandatory/initial columns, column 3: cannot resolve value 'dc1' for attribute 'address';WSTG;Bilzen, SC;dc1
 ,,,cannot create due to unresolved mandatory/initial columns, column 3: cannot resolve value 'dc2' for attribute 'address';SSTG;Georgetown, AZ;dc2

When the address field is optional for the DC, it works. So it seems the IMPEX engine can't handle Document IDs when the field is required? Is there a way around this, using plain IMPEX? (I'd rather not make address optional...)

Thanks for your input!



A reference in both directions is needed. So DC -> Address and Address -> DC, like this:

 insert Address;&Item;country(isocode);owner(&Item)[allownull=true];postalcode;region(isocode);town
 insert DistributionCenter;&Item;address(&Item)[allownull=true];code[allownull=true];name[allownull=true];owner(&Item)[allownull=true]
 ;Item1;Item0;WSTG;Bilzen, SC
 ;Item3;Item2;SSTG;Georgetown, AZ