How to change scenario ReadWriteDataGroup through API

MZ
New Contributor III

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!

1 ACCEPTED SOLUTION

JackLacava
Community Manager
Community Manager

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)
	

View solution in original post

3 REPLIES 3

JackLacava
Community Manager
Community Manager

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)
	

MZ
New Contributor III

Thanks. I will try it in a bit!

MZ
New Contributor III

Sorry I got side track until today. It works! Thanks a lot.