Skip to main content
Newcomer
November 7, 2022
Solved

How to change scenario ReadWriteDataGroup through API

  • November 7, 2022
  • 1 reply
  • 0 views

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!

Best answer by JackLacava

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)
	

1 reply

OneStream Employee
November 8, 2022

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)
	
MZ7Author
Newcomer
November 8, 2022

Thanks. I will try it in a bit!