Developer forum

Forum » PIM » Custom field types

Custom field types

Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

I know it is possible to create custom field types, and one of the pre made cusom field types are LengthFieldTypeProvider.
https://doc.dynamicweb.com/documentation-9/platform/platform-tools/field-types

Now we have a scenario where we have a field called Product Length which use this LengthFieldTypeProvider.
The field is setup too show mm as unit, and that is fine in most cases. But there are some products that are very large, and it is unnatural to use mm.

Is it possible to use one field, but be able to select the unit in each use case (product)?
Or do we have to create one field for each unit (mm/cm/m)?


Replies

 
Søren Jensen Dynamicweb Employee
Søren Jensen
Reply
This post has been marked as an answer

Hi Martin,

You can create a FieldType, that use the FieldTypeProvider "UnitsFieldTypeProvider", and define wanted Units with the "Calculation factor" in between (See below)

/Søren

 

Votes for this answer: 1
 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply
This post has been marked as an answer

Perfect, I thought I tried that one too, but I see that it does exactly what I need! Thanks :)

Votes for this answer: 1

 

You must be logged in to post in the forum