Hi,
I have a custom attribute called file ID and it is uniqe, I wont to use this attribute's value to be as the name of document file. once user clike ssave in properties page.
I used "AAHOOK_UPDATE_LINK_DATA"
LONG AAAPIHOOK Hook_PreModifyDocument2
(
LONG *hookId*/,
LONG /*hookType*/,
AAPARAM aParam1,
AAPARAM aParam2,
AARESULT* pResult
)
{
if (aParam2 != AAOPER_DOC_UPDATE_LINK_DATA)
return AAHOOK_SUCCESS;
LPAADOC_PARAM pProParam = (LPAADOC_PARAM)aParam1;
if (pProParam->lDocumentId != 0)
the problem is LPAADOC_PARAM dose not return the correct Document ID.
any Idea?
Regards
Ghazi
Hi Dan,
Please check your private message.
I think your casting way is the same as mine, we all got a pointer to AAHOOK_UPDATE_LINK_DATA. I tried to debug using your code. Still got the same error when tring to get the linkage. All other members are good, like ulMask, lTableId, lAttributeRecordId.
I believe the documentation for AAHOOK_UPDATE_LINK_DATA is incomplete. From notes I have in code that uses this hook, whenever the operation from aAparam2 is AAOPER_DOC_UPDATE_LINK_DATA, lpLinkage is not defined. This has also been my experience with it.
As you've already found, the only way to get the Doc Id in this scenario is to use aaApi_SelectLinksByAttr and then aaApi_GetLinkNumericProperty.