The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
NidhiMangtani
3 years agoContributor III
Specifying SiblingSortOrder while adding relationship through extensibility rule
Hello,
Can we figure out sibling sort order for existing members and add the new members at a specific position in hierarchy through extensibility rule?
Any samples would be helpful.
- 3 years ago
Dim relationshipPositionOptions As New RelationshipPositionOptions
relationshipPositionOptions.SiblingId = sSiblingID
relationshipPositionOptions.MovementType = RelationshipMovementType.InsertBeforeSibling
BRApi.Finance.MemberAdmin.SaveRelationshipInfo(si, relationshipInfo, relationshipPositionOptions)Specifying movementtype worked.
No assistance needed.
JennyCalvache
2 years agoNew Contributor III
Hello,
I think I may figure it out. Below is my working codes.
'Try to move Myaccountname position to before SiblingName
Dim parentMem As MemberInfo = BRApi.Finance.Metadata.GetMember(si, DimType.Account.Id, ParentName)
Dim siblingMem As MemberInfo = BRApi.Finance.Metadata.GetMember(si, DimType.Account.Id, SiblingName)
Dim myMember As MemberInfo = BRApi.Finance.Metadata.GetMember(si, DimType.Account.Id, Myaccountname)
'retrieve rel info for parent child relationship
Dim myRelInfo As RelationshipInfo = BRApi.Finance.Members.GetRelationshipInfo(si, dimTypeId.Account, Myaccountname, ParentName)
Dim newProperties As New VaryingMemberProperties( DimType.Account.id, mymember.Member.MemberId, parentmem.Member.MemberId )
'reset the position
Dim relationPosOpts As New RelationshipPositionOptions()
relationPosOpts.SiblingId = siblingMem.Member.MemberId
relationPosOpts.MovementType = RelationshipMovementType.InsertBeforeSibling
'save the relationship info and update the ownership property
BRApi.Finance.MemberAdmin.SaveRelationshipInfo(si, True, myRelInfo.Relationship,True, newProperties, relationPosOpts)
Related Content
- 2 years ago