Forum Discussion

carbon's avatar
carbon
New Contributor
9 hours ago

Help Understanding "relationshipPks As List(Of RelationshipPk)" in Relationship Removal

Hi everyone — I could use a bit of guidance.

I'm working on a function to remove a member's relationship, and I'm stuck on how to properly call relationshipPks As List(Of RelationshipPk). I'm not entirely sure what this parameter represents or how to construct the list it expects.

  • What does RelationshipPk refer to in this context?
  • How should I build the List(Of RelationshipPk) to pass into the method?

Any examples or explanations would be greatly appreciated. Thanks in advance!

 

 

1 Reply

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    You need the list of parent(s) this member you want to remove the relationships from rolls up to.

    Construct your list:

    Dim relationshipPks as New List(of RelationshipPk)
    'parse over the parents - not coded here
    Dim dimPk as new DimPk(BrApi.Finance.Dim.GetDim(si, dimensionName).DimPk


    inside the loop over the parents, (assuming parents are MemberInfo type):

    Dim relationshipPk as RelationshipPk = new RelationshipPk(dimPk.DimTypeId, parent.MemberId, DimConstants.Unknown);
    'building the list of RelationshiptPk:
    relationshipPks.Add(relationshipPk)