Getting Document Categories in an Event Handler

Paul Truman asked on January 12, 2023 18:16

I have an event handler that fires whenever I insert or update a specific page type (using AFTER). On this page type, I have a Multiple Categories selector field. When I save this page, i'm trying to get the details of those selected categories - but the DocumentCategoryInfo query is always empty. If I attempt to save the the page again though, then the document category query works.

Has anyone encountered this before - and has a workaround to access the category information after insert/update?

Correct Answer

Brenden Kehren answered on January 16, 2023 16:52

It's all timing and capturing the proper event. While I'm not 100% sure, I'd check into a different event handler. Like DocumentCategoryInfo.TYPEINFO.Events.Update.After

0 votesVote for this answer Unmark Correct answer

Recent Answers

Paul Truman answered on January 17, 2023 13:34

Many thanks - that worked. Is there any way that I can update the Tree (and page fields) in the UI after an update save? I noticed that it requires a refresh of the page after the Event firing in order to see the document name change (I am automatically updating the document name using category information selected).

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.