Developer forum

Forum » Development » Updating OrderLineGroupRelations

Updating OrderLineGroupRelations

Anders Ebdrup
Reply

Hi Dynamicweb,

 

To make it easier to add an OrderLineGroupRelation to new groups we a subscribing to: Dynamicweb.Notifications.eCommerce.Group.BeforeSave to add OrderLineGroupRelations to the group automatically, but we are facing an issue as all OrderLineGroupRelations are deleted when a group is saved by this function:

 

        Private Sub SaveGroupOrderlineRelations()
            'Save Orderline field relations. First delete all, then save.
            OrderLineFieldGroupRelation.DeleteAll(groupId)
            Dim rowCount As Integer = Base.ChkInteger(Base.Request("OrderLineFieldCount"))
            For i As Integer = 0 To rowCount - 1
                Dim fieldSystemName As String = Base.ChkString(Base.Request(String.Format("OrderLineFieldHidden_{0}", i)))
                If fieldSystemName <> "" Then
                    Dim relation As New OrderLineFieldGroupRelation(fieldSystemName, groupId)
                    relation.Save()
                End If
            Next
            grp.ClearOrderLineFieldCache()
        End Sub

 

Can it be made possible to overrule this: OrderLineFieldGroupRelation.DeleteAll(groupId)?

 

Best regards, Anders


Replies

 

You must be logged in to post in the forum