Avoid updating sortindex with Litium connect ERP

Hi,

Is there a way to avoid updating the sort index of variants when updating variants with the connect Api?
We have the problem that the customer modifies the sorting on variants in backoffice, but when we update products from the erp, the sorting gets reset. We dont have any sorting information in the ERP.
/Niclas

Litium version: 8.8

I found a workaround for this.
Set field “UpdatedFromIntegration” to true from integration and then add a validationrule for variants like this:

if(entity.Fields.GetValue<bool>("UpdatedFromIntegration"))
{ 
    var orgVariant = variantService.Get(entity.SystemId);
    entity.SortIndex = orgVariant.SortIndex;
    entity.Fields["UpdatedFromIntegration"] = false;
}
2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.