on 12-07-2017 9:27 AM
Hi, I need to set catalog version for the owner field on impex for the product owner(Product.code); I tried to define this owner(Product.code,catalogversion); but it gives unknown attributes [Item.catalogversion] How can I set this? thanks
You're very close. You need to tell it on the catalogVersion attribute header that it is importing a Product too.
Try this:
INSERT_UPDATE Product;code[unique=true];catalogVersion(catalog(id),version)[unique=true];owner(Product.code,Product.catalogVersion(catalog(id),version))
;test1;Default:Staged
;test2;Default:Staged;test1:Default:Staged
or if you'd prefer with a macro for $catalogVersion
$catalogVersion=catalogVersion(catalog(id[default=Default]),version[default=Staged])
INSERT_UPDATE Product;code[unique=true];$catalogVersion[unique=true];owner(Product.code,Product.$catalogVersion)
;test1
;test2;;test1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure there is direct way to assign catalog aware item as owner from impex.
Still you can achieve it by using document id reference. some thing like below will work for you
$productCatalog=testProductCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Online'])[unique=true,default=$productCatalog:Online]
INSERT_UPDATE Product;code[unique=true];&ref;$catalogVersion;
;testproduct;&testproduct
insert_update Address;firstName;owner(&ref)[forceWrite=true]
;testname;&testproduct
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.