Skip to Content
author's profile photo Former Member
Former Member

setting catalog version on impex owner field

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2017 at 05:43 PM

    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
    
    
    
     
    
    
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 12, 2017 at 10:31 AM

    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
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.