Forum Discussion
ChristianW
2 years agoValued Contributor
Hi Nicolas
This is an extract from one of my projects, the snippet shows how to change the languages for a member. It is untested, but it the concept should work:
Dim languageName As String = "en-US"
Dim oDimpk As DimPk = BRApi.Finance.Dim.GetDimPk(si, "Your dimension")
Dim oMemberToUpdate As MemberInfo = BRApi.Finance.Metadata.GetMember(si, oDimpk.DimTypeId, "Name of your member", True,, New MemberDisplayOptions(True, CultureInfo.CurrentCulture.Name, True,True,True, True, True, False))
Dim newDescription As String = "Hello World"
Dim testCulture As MemberDescription = Nothing
If oMemberToUpdate.Descriptions.TryGetValue(languageName, testCulture) Then
testCulture.Description = newDescription
Else
Dim testCulturePk As New MemberDescriptionPk(oDimpk.DimTypeId, oMemberToUpdate.Member.MemberId, languageName)
testCulture = New MemberDescription(testCulturePk, newDescription)
oMemberToUpdate.Descriptions.Add(languageName, testCulture)
End If
brapi.Finance.MemberAdmin.SaveMemberInfo(si, oMemberToUpdate, False, False, True, TriStateBool.FalseValue)
Cheers
Christian
Related Content
- 2 months ago
- 2 years ago
- 6 months ago