Documentation Center

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 NameField Level
The name of the field specified in the ConditionMetadataField parameterThe level of the field specified in the ConditionMetadataFieldLevel parameter
The name of the field specified in the SetMetadataField parameterThe level of the field specified in the SetMetadataFieldLevel parameter
The following parameters can be configured:
ParameterRequiredDefault valueAllowed valuesDescription
ConditionMetadataFieldYes  The metadata field that needs to be checked for changes. Only string fields are supported, number and date fields are not.
ConditionMetadataFieldLevelNolnglogical, version, lngThe metadata field level that needs to be checked for changes
ConditionMetadataFieldValueTypeNovaluevalue, elementThe metadata field value type
ConditionMetadataFieldFromValueNo  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.
ConditionMetadataFieldToValueNo  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.
SetMetadataFieldYes  The metadata field to set. Needs to be a date field.
SetMetadataFieldLevelNolnglogical, version, lngThe level of the metadata field to set
SetMetadataFieldOverwriteExistingNoYesYes, NoWhether 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>