New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Lieutenant Commander Lieutenant Commander
Lieutenant Commander
419 views

Updating classification access controls with TRIMSDK

Jump to solution

I'm trying to work out how I can update the default access controls on a classification using VBA. I can get it to spit out the current locations list with eg

Call objClassification.GetCopiedAccessControlDetailsEx(dxViewDocument, asInherited, objLocations, xrNoRefCopy)

Where objLocations returns the location list correctly. However when I try to update it with

Call objClassification.SetCopiedAccessControlDetailsEx(dxViewDocument, asInherited, objNewLocations, xrNoRefCopy)

objClassification.Save

The location list is set to null and defaults to Everyone. Given I was able to get the locations out I'd assumed I could do the same thing to put them back in, but I'm obviously doing something wrong.

Also, is it possible to loop through the various access control types somehow, or do I need to specifically call dxViewDocument, dxUpdateDocument, etc?

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Vice Admiral
Vice Admiral

@CAHS RC  Does using asAccessControlSettings.asPrivate not work? It's good on my end using the trimsdk.dll

asPrivate is used when setting location(s) and asInherited is for Based on Container

 

Here is my full code using where I'm setting to to a location with a uri of 7.

 

        Dim objTRIM As New Database
        objTRIM.Connect()

        Dim objNewLocations As Location
        objNewLocations = objTRIM.GetLocation(7)

        Dim objClassification As Classification
        objClassification = objTRIM.GetClassification("ANIMAL MANAGEMENT")
        objClassification.SetCopiedAccessControlDetailsEx(dxRecordAccess.dxViewDocument, asAccessControlSettings.asPrivate, objNewLocations, xrAccessReferenceStyle.xrNoRefCopy)
        objClassification.Save()

View solution in original post

6 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi @CAHS RC. Do you still need assistance with this? 

I don't have the expertise to answer this but I'll try and get some answers for you. 

 

Shiela

*** Any posts I make on this forum are my own personal opinion and should not be interpreted as an official statement on behalf of Micro Focus ***
Highlighted
Lieutenant Commander Lieutenant Commander
Lieutenant Commander
Hi Shiela, thanks for that. I still haven't been able to work this one out, I can't see what I'm doing wrong that lets me get but not set the locations. Any suggestions would be welcome.
0 Likes
Highlighted
Vice Admiral
Vice Admiral

@CAHS RC 

I can set locations to the Default Record Access of a Classification however I use asAccessControlSettings.asPrivate

 

Highlighted
Lieutenant Commander Lieutenant Commander
Lieutenant Commander

Hi Shiela

I'm not sure why my reply to this seems to have marked the post as having a solution, so I've reverted that. I've still got no idea why I can't make this work, it's the only property I've found that I can't amend.

0 Likes
Highlighted
Vice Admiral
Vice Admiral

@CAHS RC  Does using asAccessControlSettings.asPrivate not work? It's good on my end using the trimsdk.dll

asPrivate is used when setting location(s) and asInherited is for Based on Container

 

Here is my full code using where I'm setting to to a location with a uri of 7.

 

        Dim objTRIM As New Database
        objTRIM.Connect()

        Dim objNewLocations As Location
        objNewLocations = objTRIM.GetLocation(7)

        Dim objClassification As Classification
        objClassification = objTRIM.GetClassification("ANIMAL MANAGEMENT")
        objClassification.SetCopiedAccessControlDetailsEx(dxRecordAccess.dxViewDocument, asAccessControlSettings.asPrivate, objNewLocations, xrAccessReferenceStyle.xrNoRefCopy)
        objClassification.Save()

View solution in original post

Highlighted
Lieutenant Commander Lieutenant Commander
Lieutenant Commander

Aha! Yes, that's it. I was bamboozled by the fact that I used asInherited in GetCopiedAccessControls, and when it returned the correct results I just ran with that assuming it was the right one to use. Thanks!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.