Developer forum

Forum » Development » Overriding ProductField ID

Overriding ProductField ID

Anders Ebdrup
Reply

Hi Dynamicweb,

 

Can it be possible to override the ID when creating a ProductField by the api? Because when making integrated solutions we need to know the id of the field.

So in the Else-section of "Save(ByVal fieldIdStr As String)"


            If objDataset.Tables(0).Rows.Count > 0 Then
                objRow = objDataset.Tables(0).Rows(0)
            Else
                objRow = objDataset.Tables(0).NewRow
                objDataset.Tables(0).Rows.Add(objRow)
                ID() = NumberGenerator.GetNumber("FIELD")
                objRow("ProductFieldID") = ID()
                objRow("ProductFieldSystemName") = SystemName()
                objRow("ProductFieldTypeID") = TypeID()
                objRow("ProductFieldTypeName") = FieldType.getFieldTypes(TypeID()).Item(0).Name
            End If

I would like to have this instead:

                objRow = objDataset.Tables(0).NewRow
                objDataset.Tables(0).Rows.Add(objRow)

                If Not String.IsNullOrEmpty(fieldIdStr) Then
                    ID() = fieldIdStr
                Else
                    ID() = NumberGenerator.GetNumber("FIELD")
                End If

                objRow("ProductFieldSystemName") = SystemName()
                objRow("ProductFieldTypeID") = TypeID()
                objRow("ProductFieldTypeName") = FieldType.getFieldTypes(TypeID()).Item(0).Name

Best regards, Anders


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Of course.

Added to source, TFS#23031, ready for next 8.8.1 hotfix.

BR Nicolai

Votes for this answer: 1
 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Anders

The problem TFS#23031 "Make it possible to override fieldid on creation using the API/Integration"  has now been fixed in version 8.8.1.16

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/latest-releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards

Dynamicweb Support

Kristian Kirkholt

 

You must be logged in to post in the forum