I have updated the logic to clear the field during display start event. Note: Updated my logic in readonly.js GUI extension
if($display)
{
$evt.addEventHandler($display,start,ResetMetadataField)
}
Function ResetMetadataField()
{
//code goes here
var fieldBuilder = view.properties.fieldBuilder;
var metadataTab = GetMetadataTab()
if(metadataTab)
{
var fieldbuilder = GetMetadataFieldBuilder();
//logic goes here to reset the metadata field
}
}
But this code triggers during Save event as well. I need to reset the field only when component is re-opened but not on Save.
I am unable to differentiate between item re-open and other events like save,check-in..etc Is there a way to achieve the functionality?