Document Code change to trigger rename Document Name

The filename already changes when the document name is changed but I need the document name to change when the document name is changed.

I assume I'll need to create a custom module with a post trigger on the Doc code written in C++ and register the module. Then add the dll to everyone's PWE.

Looking for guidance here as I normally write external programs in VB.NET.

Parents
  • Kevin,

    It isn't clear to me what exactly you are trying to do. What do you mean by "..I need the document name to change when the document name is changed."?

    As I like to say, "words get in the way".  I think you mean HOOK when you say "trigger".  And yes, you set hooks by the use of a custom module.

    I suspect that you are asking about a way to keep the document's name and the document's filename in sync when the document's "Document Code" is changed.

    I would suggest that you take a look at my "HookWatcher" tool and walk through the steps you want to automate to see what hooks are available for each part of the process.  I suspect that if you are updating the document's "Document Code', that it will "fire" AAHOOK_UPDATE_LINK_DATA, and with a post hook (success), you could then examine the document's name and file name to see if they match the "PlaceHolder" part of the Document Code and then change the document's name and filename to match.

    But I'm just guessing on what you want to do.

    And along with more details on what you are trying to accomplish, it is always helpful to specify what version of ProjectWise you are using, including the version of the PW SDK.

  • Dan,

    You are correct, I want the Document Code post hook success to sync the Document Name and Filename.
    PWE 10.00.03.280, PW SDK 2018

  • See if setting a post hook on AAHOOK_CODE_GENERATION_DLG is what you need.  I suspect that this hook only "fires" if you are using the Document Code Dialog.

    If you are setting the Document Code via API functions,then I suspect that AAHOOK_UPDATE_LINK_DATA may be the approach that may work for your needs.

    You may want to review the HookImpl sample code included with the ProjectWise SDK as it sets up a pre, action and post hook which you can use as a "starting" point for your efforts.

Reply
  • See if setting a post hook on AAHOOK_CODE_GENERATION_DLG is what you need.  I suspect that this hook only "fires" if you are using the Document Code Dialog.

    If you are setting the Document Code via API functions,then I suspect that AAHOOK_UPDATE_LINK_DATA may be the approach that may work for your needs.

    You may want to review the HookImpl sample code included with the ProjectWise SDK as it sets up a pre, action and post hook which you can use as a "starting" point for your efforts.

Children