11-07-2022 09:34 AM - last edited on 05-02-2023 10:43 AM by JackLacava
We are trying to temporarily disable the Write access on a scenario to Everyone during a long DM sequence. We were able to find the ManageDataGroup under Scenario Properties, however, we could not find anything for ReadWriteDataGroup, which is a XMLConstants based on the API reference. Any help appreciated!
Solved! Go to Solution.
11-08-2022 05:03 AM
RWDataGroup is not a variable property, but rather an actual property of the member. To edit it, you need to create a WritableMember object and save that.
' retrieve your original scenario somehow, this comes from the current Workflow
Dim myScen As Member = BRApi.Finance.Members.GetMember(si, dimtype.Scenario.Id, si.WorkflowClusterPk.ScenarioKey)
' set up a writable object
Dim newScen As New WritableMember(myscen)
' change properties, including ReadWriteDataGroup
newScen.Name = "ABC"
' when done, save it back.
brapi.Finance.MemberAdmin.SaveMemberInfo(si, True, newScen, False, Nothing, False, Nothing, False)
11-08-2022 05:03 AM
RWDataGroup is not a variable property, but rather an actual property of the member. To edit it, you need to create a WritableMember object and save that.
' retrieve your original scenario somehow, this comes from the current Workflow
Dim myScen As Member = BRApi.Finance.Members.GetMember(si, dimtype.Scenario.Id, si.WorkflowClusterPk.ScenarioKey)
' set up a writable object
Dim newScen As New WritableMember(myscen)
' change properties, including ReadWriteDataGroup
newScen.Name = "ABC"
' when done, save it back.
brapi.Finance.MemberAdmin.SaveMemberInfo(si, True, newScen, False, Nothing, False, Nothing, False)
11-08-2022 09:22 AM
Thanks. I will try it in a bit!
12-08-2022 12:10 AM
Sorry I got side track until today. It works! Thanks a lot.