Skip to main content
September 22, 2023
Solved

Entity Security using extender rule

  • September 22, 2023
  • 3 replies
  • 12 views

Hi - Has anyone created entity readdatagroup using the below function 

 

Dim objGroup As Group = Group.CreateEntityReadDataGroup()

 

Any help would be appreciated 

Best answer by Krishna

I found the solution and the below is the code sample for updating the Entity Security Group. The below update the Display Group for an entity 

 

'Assign the Display Group 
Dim objWritableMember As WritableMember = BRApi.Finance.Members.ReadWritableMemberNoCache(si, dimTypeId.Entity, EntityName)
objWritableMember.ReadDataGroupUniqueID2 = BRApi.Security.Admin.GetGroup(si,ReadDataGroup2).Group.UniqueID
BRapi.Finance.MemberAdmin.SaveMemberInfo(si,True,objWritableMember,False,Nothing,False,Nothing,TriStateBool.FalseValue)

 

3 replies

September 25, 2023

Some of the APIs are for internal use.

What are you trying to do, exactly? There is probably an easier way than rummaging through unknown functions.

KrishnaAuthorAnswer
September 25, 2023

I found the solution and the below is the code sample for updating the Entity Security Group. The below update the Display Group for an entity 

 

'Assign the Display Group 
Dim objWritableMember As WritableMember = BRApi.Finance.Members.ReadWritableMemberNoCache(si, dimTypeId.Entity, EntityName)
objWritableMember.ReadDataGroupUniqueID2 = BRApi.Security.Admin.GetGroup(si,ReadDataGroup2).Group.UniqueID
BRapi.Finance.MemberAdmin.SaveMemberInfo(si,True,objWritableMember,False,Nothing,False,Nothing,TriStateBool.FalseValue)

 

February 24, 2026

Hey JackLacava​ Krishna​ ,

I am using an Exclusion group on my Entity Read Group 1. However, when I try to pull the member, it is giving me an object reference error. It works fine if the entity Security group is not an exclusion group.

Regards,
Nikhil Powar

February 25, 2026
Dim ExGrpDict As New Dictionary(Of Guid,String)

For Each ExGrp As ExclusionGroup In BRApi.Security.Admin.GetExclusionGroups(si)

          ExGrpDict.Add(ExGrp.UniqueID,ExGrp.Name)

Next

If ExGrpDict.ContainsKey(BrApi.Finance.Members.ReadWritableMemberNoCache(siSource, dimTypeId.Entity,Mem.Member.Name).ReadDataGroupUniqueID) Then
	newRow("ReadDataGroup") =  ExGrpDict(BrApi.Finance.Members.ReadWritableMemberNoCache(siSource,dimTypeId.Entity,Mem.Member.Name).ReadDataGroupUniqueID)
Else 
	newRow("ReadDataGroup") =  BRApi.Security.Admin.GetGroupInfoEx(siSource,BrApi.Finance.Members.ReadWritableMemberNoCache(siSource, dimTypeId.Entity,Mem.Member.Name).ReadDataGroupUniqueID).GroupInfo.Group.Name
End If

I used another approach to achieve this as 
BRApi.Security.Admin.GetGroupInfoEx(siSource,BrApi.Finance.Members.ReadWritableMemberNoCache(siSource, dimTypeId.Entity,Mem.Member.Name).ReadDataGroupUniqueID).GroupInfo.Group.Name
as the line as not giving me the Exclusion group name and was throwing and Error: Object reference not set to an instance of an object.

Regards,
Nik