DURATION
A duration field is useful to configure durations like 30 days, 2 hours 40 minutes etc. To configure a Duration field either in filter or retrieval criteria, set the field type as DURATION and configure the SimpleMapping to map the field with the SQL parameter.
Following is an example of display a DURATION field.
Include the duration column in the select clause. In the following example, ReturnPolicy which is a duration field from the book model is illustrated.
select return_policy RETURN_POLICY FROM ZBKS_Book
The retrieval should be defined as follows:
<CustomRetrievalField>
<FieldRef levelType=
"ZBKS.Book"
category=
"PDF"
>
<FieldName>Return Policy</FieldName>
</FieldRef>
<Type>DURATION</Type>
<SimpleMapping sqlName=
"return_policy"
/>
</CustomRetrievalField>
Following are the key points to note:
LevelType in the FieldRef is pointed to Book, which is where the ReturnPolicy field is defined.
Field Category is set to PDF(PreDefined Field)
Type is set as DURATION (Note the capital letters)
SimpleMapping is defined in the CustomRetrievalField
SimpleMapping is used to map the SQL parameter with the field name.