IWriteMetadataPlugin - OnFieldChangeSetDate
Sets a date field when a certain metadata field is changed. Optionally you can specify that the date should only be set when the metadata field has changed from a certain value to a certain value.
Plugin Configuration
The following workset fields need to be configured:
| Field Name | Field Level |
|---|---|
| The name of the field specified in the ConditionMetadataField parameter | The level of the field specified in the ConditionMetadataFieldLevel parameter |
| The name of the field specified in the SetMetadataField parameter | The level of the field specified in the SetMetadataFieldLevel parameter |
The following parameters can be configured:
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| ConditionMetadataField | Yes | The metadata field that needs to be checked for changes. Only string fields are supported, number and date fields are not. | ||
| ConditionMetadataFieldLevel | No | lng | logical, version, lng | The metadata field level that needs to be checked for changes |
| ConditionMetadataFieldValueType | No | value | value, element | The metadata field value type |
| ConditionMetadataFieldFromValue | No | The current database value of the metadata field should match one of the given values before the SetDate will happen. Multiple values can be comma-space separated. If not provided, this means the database value can be anything. | ||
| ConditionMetadataFieldToValue | No | The current value of the metadata field should match one of the given values before the SetDate will happen. Multiple values can be comma-space separated. If not provided, this means the database value can be anything. | ||
| SetMetadataField | Yes | The metadata field to set. Needs to be a date field. | ||
| SetMetadataFieldLevel | No | lng | logical, version, lng | The level of the metadata field to set |
| SetMetadataFieldOverwriteExisting | No | Yes | Yes, No | Whether to override when the field already has a value or not. |
<plugin name="SETREVIEWENDDATE" handler="OnFieldChangeSetDate"
ishcondition="ISHLevel='lng' and CurrentAction='SetMetadata'">
<description>Sets the review start date to the current date when the 'FSTATUS' field is changed from 'Draft' to 'To be Reviewed'</description>
<workingset>
<ishfields>
<ishfield name="FISHPUBSTATUS" level="lng" />
<ishfield name="FISHPUBREVIEWENDDATE" level="lng" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="ConditionMetadataField">FISHPUBSTATUS</parameter>
<parameter name="ConditionMetadataFieldLevel">lng</parameter>
<parameter name="ConditionMetadataFieldValueType">element</parameter>
<parameter name="ConditionMetadataFieldToValue">VPUBSTATUSRELEASED</parameter>
<parameter name="SetMetadataField">FISHPUBREVIEWENDDATE</parameter>
<parameter name="SetMetadataFieldLevel">lng</parameter>
<parameter name="SetMetadataFieldOverwriteExisting">Yes</parameter>
</parameters>
</initialize>
</plugin>