Hallo,
I need to set Categroy for Shortcut but it does not work. May be the issue is, that for Shortcuts i have
-> Shortcut -> Properties -> Categroies and
-> Original -> Properties -> Categroies
But i have no idea and could not found yet any documention i understand about that topic ...
I use the same code as Setting Categries for Folders (which works fine). I use this code (form here
https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=13551128&objAction=viewincontainer&ShowReplyEntry=17995134#forum_topic_17995134, more detailed from here: https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=17996016&objAction=download )
I expect the error in this part:
// Get DPINODE by node id
DAPINODE targetNode = DAPI.GetNodeByID( prgCtx.DapiSess(), DAPI.BY_DATAID, nodeID )
//Get object llnode
Object objllnode = $LLIApi.LLNodeSubsystem.GetItem( targetNode.pSubType )
For Folders this works fine.
For Shortcuts it does not. I can make it working by changing "targetNode.pSubType" to 0. But i do not know what this "targetNode.pSubType" is or should be ...
btw: targetNode is the Shortcut.
btw2: the Error i got is very confusing, and i do not think this is really the problem
this is the output
targetNode.pName: 002 Test Link (1110001101)
targetNode.pSubType: 1
objllnode: #41da058
originalCatResult: A<1,?,'ApiError'=?,'AttrData'=<LL:Frame>{{fParent:#400346a}fAddedCategories:V{<'Name','Key'>},fAttrChangePrefix:'',fData:A<1,?>,fDefID:?,fDefinitions:A<1,?>,fDeletedCategories:V{<'Name','Key'>},fID:21230,fNewCreation:false,fNoPermData:?,fPrgCtx:#41da09c,fUserData:?,fValueChanges:V{<'Key','Old','New'>},fVerNum:0}</LL:Frame>,'ErrMsg'='','OK'=true>
attrData. <LL:Frame>{{fParent:#400346a}fAddedCategories:V{<'Name','Key'>},fAttrChangePrefix:'',fData:A<1,?>,fDefID:?,fDefinitions:A<1,?>,fDeletedCategories:V{<'Name','Key'>},fID:21230,fNewCreation:false,fNoPermData:?,fPrgCtx:#41da09c,fUserData:?,fValueChanges:V{<'Key','Old','New'>},fVerNum:0}</LL:Frame>
result3: A<1,?,'ApiError'=?,'AttrSet'={17347,3},'ErrMsg'='','OK'=true>
dyn: A<1,?,'ErrMsg'='SAPObjectId is a required field.','KeyID'=2,'OK'=false>
of this code here:
//////////////////////////////////
echo ("targetNode.pName: " , targetNode.pName)
echo ("targetNode.pSubType: " , targetNode.pSubType)
//Get object llnode
Object objllnode = $LLIApi.LLNodeSubsystem.GetItem( targetNode.pSubType )
//Object objllnode = $LLIApi.LLNodeSubsystem.GetItem( 0 )
echo ("objllnode: " , objllnode)
//Get node category info
Dynamic originalCatResult = objllnode.NodeCategoriesGet( targetNode )
echo ("originalCatResult: " , originalCatResult)
//get nodecategory attributedata
Dynamic attrData = originalCatResult.AttrData
echo("attrData. ", attrData)
//Add desired category info to attrdata
Dynamic result3 = attrData.AttrGroupAdd( categoryID )
echo ("result3: " , result3)
//Update node category info
Dynamic dyn = objllnode.NodeCategoriesUpdate( targetNode, attrData )
echo ("dyn: " , dyn)
//////////////////////////////////
If i switch those two lines, it "seams" to work also for Shortcuts (Alias) but is this the way to do it? What are the possible concequences?
//Get object llnode
Object objllnode = $LLIApi.LLNodeSubsystem.GetItem( targetNode.pSubType )
//Object objllnode = $LLIApi.LLNodeSubsystem.GetItem( 0 )
Any information available on that issue?
Thanks
Thomas