eric_h - Tuesday, October 11, 2011 7:31 PM:
The 'PE_clean_has_files_prop' is a C# Method that clears the 'has_files' property on Document and Manufacturer Part item types on OnBeforeAdd and OnBeforeUpdate server side events for these item types.
I get that this is to guarantee that the property is not set in case files have been deleted. And I assume it clears the (Boolean) value on any new or change to Document of Manufacturer Part. I was going to ask what resets the property, but I did find the 'PE_update_has_files_flag' C# Method. This appears to be applied to the 'Document File' and 'Manufacturer Part File' relationships to the above. The server events that trigger this Method are 'OnAfterAdd', 'OnAfterDelete', 'OnAfterUpdate', 'OnAfterVersion'.
I guess now my question is, if I follow this correct that the flag gets removed when you add or update a Document or Manufacturer Part, does that add or update also trigger any of the events tied to the '... File' relationships so that they can check for the presence of a file and set the flag if there is one? I guess I am confused that the events are called on the relationship to check for the file, but maybe these kinds of events are triggered by changes to the source item.
Since all the above events are ItemType events, is that correct? Do you need to specifically call Grid events to respond to actions that are applied directly to grid rows and cells?
I am just trying to better understand the behavior related to files and attachments and this question came up.
Thanks,
Eric