Developer forum

Forum » Integration » 'Apply On Create Only' is not working for 'Groups' field in Product Sync jobs

'Apply On Create Only' is not working for 'Groups' field in Product Sync jobs

Aye Nyein Myat Dynamicweb Employee
Aye Nyein Myat

Dear All, 

I have two product sync jobs that is integrated with NAV, one is  for parent product and one  is for variant product. 
In those two jobs, I put one specific Group ID as constant in 'Groups' field upon creation only to put the newly synced products which are not enriched yet and do not want to show on frontend.
Therefore, I choose 'Apply on Create only' checkbox on that field. But when I syned the existing product in DW to update some field, that product was also added to that group.
Could you please advise whether the checkbox 'Apply on Create only' is not working properly or it is not working like what I expected to be?

Best Regards, 



Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk

Hi Nyein,
it works with regular columns, but "Groups" is a special "virtual" column that is handled in a special way, so it doesn't work for this case.

It seems you need to write a small custom table script:
keep the "Groups" column in the mapping and in the ProcessInputRow check the row["Groups"] string value:
if the product in the row is existing then set row["Groups"] to emty string,
if the product is new then do nothing (keep the const value in the row["Groups"]).
Hope that will help.
BR, Dmitrij


You must be logged in to post in the forum