cancel
Showing results for 
Search instead for 
Did you mean: 

create a new product catalog sync that perform only synchronisation of pricerow

MarcoCoppola
Explorer
0 Kudos
565

Hi,

one requirement of my project is the only synchronisation of priceRow because them are imported from an external system, while the products (and other items) must follow the canonical way.

I tried to create a new syncJob with the impex below;

I understood that for select items and attributes that are needed to be sync I must work on attributeDescriptor but I don't know how.

 

$solPrefix = myProject
    
INSERT_UPDATE CatalogVersionSyncJob ; code[unique=true,path-delimiter=!]      ;sourceVersion(catalog(id),version)     ;targetVersion(catalog(id),version)     ; syncPrincipals(uid) ; removeOnExit ; sessionUser(uid) ; syncLanguages(isocode) 
                                    ; sync $solPrefixPriceRow:Staged->Online  ;$solPrefixProductCatalog:Staged        ;$solPrefixProductCatalog:Online        ; syncuser            ; true         ; syncuser         ; en,it
 
 
INSERT_UPDATE SyncAttributeDescriptorConfig ; syncJob(code)[unique=true,path-delimiter=!]  ; attributeDescriptor(enclosingType(code),qualifier)[unique=true] ; includedInSync ; copyByValue
                                            ; sync $solPrefixPriceRow:Staged->Online 	   ; priceRow:products                                           ; false          ; false    		 
#                                            ; sync $solPrefixPriceRow:Staged->Online 	   ; Category:products                                           ; false          ; false    		 

 

the run of the impex return the error:

									
INSERT_UPDATE SyncAttributeDescriptorConfig;syncJob(code)[unique=true,path-delimiter=!];attributeDescriptor(enclosingType(code),qualifier)[unique=true];includedInSync;copyByValue
,,,,error finding existing item : column='attributeDescriptor' value='priceRow:products', | column 2: could not resolve item for priceRow:products;sync myprojectPriceRow:Staged->Online;priceRow:products;false;false

That I need to put on attributeDescriptor for select only priceRow?

And (in general) how works the multivalue referenced types?

Anyone have tips?

Marco

Accepted Solutions (0)

Answers (1)

Answers (1)

andyfletcher
Active Contributor

If your prices are coming from an external source then do you really need them to be catalog version aware? In more recent versions of SAP Commerce prices are decoupled from products and linked by a 'soft' relationship on product code.

https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/aa417173fe4a4ba5a473c93eb730a417/8ba99c3b8...

You can have you prices imported from an external source and they immediately become the current price for products in both the staged and online catalogs.

To answer your actual question, I'm not really sure what you are trying to achieve with your SyncAttributeDescriptor config but the attributeDescriptor needs to define a valid attribute. There is no 'products' attribute on the 'PriceRow' type. If I understand your question correctly, I think you'd be better using the 'rootTypes' attribute on the CatalogVersionSyncJob to just sync PriceRow types and potentially mark the 'product' (note no 's') attribute as includedInSync=false so that it doesn't try and sync the linked product.

MarcoCoppola
Explorer
0 Kudos

you got the point right.

to answer at your question: no, we don't need strictly the prices versioned but we decided to keep them as them are, consider that there are also others business requirement. One other solution keep in analysis at the beginning was write the prices directly on online catalogue, but it was not the solution chosen.

about the impex: I want create another CatalogVersionSyncJob to synchronise only the priceRow items. I don't know what I need to put on the attributeDescriptor for do that.

this insert below works fine

INSERT_UPDATE CatalogVersionSyncJob ; code[unique=true,path-delimiter=!]      ;sourceVersion(catalog(id),version)     ;targetVersion(catalog(id),version)     ; syncPrincipals(uid) ; removeOnExit ; sessionUser(uid) ; syncLanguages(isocode) 
                                    ; sync $solPrefixPriceRow:Staged->Online  ;$solPrefixProductCatalog:Staged        ;$solPrefixProductCatalog:Online        ; syncuser            ; true         ; syncuser         ; en,it
 

the insert of SyncAttributeDescriptorConfig below fail

INSERT_UPDATE SyncAttributeDescriptorConfig ; syncJob(code)[unique=true,path-delimiter=!]  ; attributeDescriptor(enclosingType(code),qualifier)[unique=true] ; includedInSync ; copyByValue
                                            ; sync $solPrefixPriceRow:Staged->Online 	   ; XXXXXX:YYYYYYY                                           ; false          ; false

what can I put on attributeDescriptor to create the respective items for update ONLY priceRows?